import Experiment1 as exp1 import Experiment5 as exp5 import Experiment6 as exp6 import CrossValidation as cross def initialize(): dominios = parseDominio() anotacoes = parseAnnotation() atributos = ["type", "others", "hpos", "vpos", "next", "left", "right", "below", "above"] targets = {"abs1":"e2", "abs3":"e2", "abs5":"e3", "proj1":"e2", "proj3":"e4", "proj5":"e2" } return dominios, anotacoes, atributos, targets if __name__ == '__main__': dominios, anotacoes, atributos, targets = initialize() anotacoes = exp1.run(dominios, anotacoes, atributos, targets) folds = cross.crossValidation(anotacoes) folds = exp5.run(dominios, folds, atributos, targets, 0.7) folds = exp6.run(dominios, folds, atributos, targets, 0.7) dice = [] diceGlobal = [] dicePersonalizado = [] diceGlobalSuperespecificado = [] dicePersonalizadoSuperespecificado = [] print "DICE \t DICE GLOBAL \t DICE PERSONALIZADO \t" for fold in folds:
# from hcluster import * import Assurance as ass from ParserGIVE import * import CrossValidation as cross import Experiment1 as exp1 import Experiment2 as exp2 import Experiment3 as exp3 import Experiment4 as exp4 import Experiment5 as exp5 def initialize(): dominios = parseDominio() anotacoes = parseAnnotation() atributos = ['leftaround', 'right', 'orientation', 'color', 'straight', 'next', 'slightlyleft', 'rightaround', 'left', 'type', 'slightlyright'] return dominios, anotacoes, atributos if __name__ == '__main__': contextos, anotacoes, atributos = initialize() folds = cross.crossValidation(10, anotacoes) anotacoes = exp1.run(contextos, anotacoes, atributos) exp2.run(contextos, folds, atributos) exp3.run(contextos, folds, atributos) exp4.run(contextos, folds, atributos) exp5.run(contextos, folds, atributos)
def initialize(): anotacoes = parser.parseAnnotation() dominios = parser.parseMapas() participantes = anotacoes[1] targets = {"1":["rest3"],"2":["cafe1"],"3":["drug3"],"4":["chur3"],"5":["pub1"],"6":["chur2","chur3"],"7":["rest1","rest2"],"8":["drug2","drug3"],"9":["drug3","drug4"],"10":["rest4","rest5"],"11":["rest3"],"12":["cafe1"],"13":["rest4","rest5"],"14":["chur3"],"15":["pub1"],"16":["chur2","chur3"],"17":["rest1","rest2"],"18":["drug2","drug3"],"19":["drug3","drug4"],"20":["rest4","rest5"]} atributos = ["type","in","name","next-to","in-front-of","other","right-to","left-to","behind"] return dominios, targets, anotacoes[0], atributos, participantes if __name__ == '__main__': dominios, targets, anotacoes, atributos, participantes = initialize() folds = cross.crossValidation(10, anotacoes) print "Machine Learning sem ID" exp1.run(dominios, targets, folds, atributos, participantes, False) print participantes print "\n\n" print "Machine Learning com ID" exp1.run(dominios, targets, folds, atributos, participantes, True) # anotacoesParticipante = {} # # for anotacao in anotacoes: # participante = anotacao["caracteristicas"]["trial"] # if participante not in anotacoesParticipante: # anotacoesParticipante[participante] = [] # anotacoesParticipante[participante].append(anotacao) # # acuraciaTotal = 0.0 # diceTotal = []