def TestFeatureSelection(): data = Data("cs_170_small80.txt") dat = data.preprocess() print dat.shape print "dat type: ", type(dat) col_nums = dat.shape[1] feature_indices = [] for d in range(col_nums): feature_indices.append(d) print data.selectFeature(dat,feature_indices )
def TestClassifier(): data = Data("cs_170_small80.txt") start = time.time() d = data.selectFeature(data.data, [0,5,3,7]) validator = LeaveOneOutValidator(d, KnearestNeighbor) print validator.validate() print "time: ", time.time() -start