def testRiemannKNN(mult_donnees,mesDonnees_test): print("debut test riemann KNN") result=[] for r,donnees in mult_donnees.items(): print("r = "+str(r)) m = GenericModele(pyriemann.classification.KNearestNeighbor(n_neighbors=3),donnees) m.dataToCov() m.fit() s = m.score(mesDonnees_test[r].data,mesDonnees_test[r].labels) result.append([r,s]) print("reactionTime,f1score : "+str(result)) return result
def testRiemannMDMPlusXdawn(mult_donnees,mesDonnees_test): print("debut test riemann MDM") result=[] for r,donnees in mult_donnees.items(): print("r = "+str(r)) m = GenericModele(pyriemann.classification.MDM(),donnees) m.dataToXdawnCov() m.fit() s = m.score(mesDonnees_test[r].data,mesDonnees_test[r].labels) result.append([r,s]) print("reactionTime,f1score : "+str(result)) return result
def testSVMBrut(mult_donnees,mesDonnees_test): print("debut test SVM brut") result=[] for r,donnees in mult_donnees.items(): print("r = "+str(r)) clf = SVC(gamma='auto',probability=True,max_iter=100,verbose=1) m = GenericModele(clf,donnees) m.vectorize() m.fit() s = m.score(mesDonnees_test[r].data,mesDonnees_test[r].labels) result.append([r,s]) print("reactionTime,f1score : "+str(result)) return result
def testKNNBrut(mult_donnees,mesDonnees_test): print("debut test knn brut") result=[] for r,donnees in mult_donnees.items(): print("r = "+str(r)) neigh = KNeighborsClassifier(n_neighbors=3) m = GenericModele(neigh,donnees) m.vectorize() m.fit() s = m.score(mesDonnees_test[r].data,mesDonnees_test[r].labels) result.append([r,s]) print("reactionTime,f1score : "+str(result)) return result
def testKNNPaseBas(nbPoint,slider,mult_donnees,mesDonnees_test): print("debut test passe bas knn") result=[] for r,donnees in mult_donnees.items(): print("r = "+str(r)) neigh = KNeighborsClassifier(n_neighbors=3) m = GenericModele(neigh,donnees) m.vectorize() m.dataToMoy(nbPoint,slider) m.fit() s = m.score(mesDonnees_test[r].data,mesDonnees_test[r].labels) result.append([r,s]) print("reactionTime,f1score : "+str(result)) return result