def setupClassifier(path): l = p.getTrialList(path) for x in l: features = f.Features(x) data.append(features.feature) if x.head.target == 'good': label.append(1) else: label.append(0)
def getTrainingData(path): l = p.getTrialList(path) for x in l: features = f.Features(x) data.append(features.feature) if x.head.target == 'good' or path[-2] != 'k': label.append(1) else: label.append(0) print data[-1], label[-1]
def getTestingData(path): l = p.getTrialList(path) for x in l: features = f.Features(x, path[-2]) data_test.append(features.feature) if x.head.target == 'good': label_test.append(1) else: label_test.append(0) print data_test[-1], label_test[-1]
def setupClassifier(path): data = [] label = [] l = p.getTrialList(path) for x in l: features = f.Features(x, path[-2]) data.append(features.feature) if x.head.target == 'good': label.append(1) else: label.append(0) return knn.knn(data, label)
def setupClassifier(path): data = [] label = [] l = p.getTrialList(path) for x in l: features = f.Features(x,path[-2]) data.append(features.feature) if x.head.target == 'good': label.append(1) else: label.append(0) return knn.knn(data, label)