From fd3d5ca93d06dfc7d9556c981d75a171ad1666a5 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Sun, 30 Mar 2014 23:39:57 -0700 Subject: [PATCH] all classifiers also working --- appClassifierBenchmark.py | 110 ++++- classifier.py | 2 +- docs/classifier_benchmark.md | 862 +++++++++++++++++------------------ wiki | 2 +- 4 files changed, 523 insertions(+), 453 deletions(-) diff --git a/appClassifierBenchmark.py b/appClassifierBenchmark.py index 1a7ac0b..81fbacb 100644 --- a/appClassifierBenchmark.py +++ b/appClassifierBenchmark.py @@ -29,6 +29,7 @@ def getUserInput(models): optionparser = OptionParser(add_help_option=False, epilog="multiline") optionparser.add_option('-c', '--classifier', dest='classifier', default="all") + optionparser.add_option('-s', '--sample', dest='sample', default="all") optionparser.add_option('-h', '--help', dest='help', action='store_true', help='show this help message and exit') optionparser.add_option('-f', '--file', dest='file') @@ -58,7 +59,11 @@ def getUserInput(models): return optionparser.error('Data File path not provided.\n Usage: --file="path.to.appData"') - return { 'classifier' : option.classifier, 'file': option.file } + return { + 'classifier' : option.classifier, + 'file': option.file, + 'sample' : option.sample + } @@ -101,9 +106,9 @@ def trimDf(df): -def prepareClassifier(df, models, choice): +def prepareSplitClassifier(df, models, choice): """ - Classify the apps + Classify the apps for equal splits """ @@ -119,7 +124,7 @@ def classificationOutput(clf, X, Y): print "#" * 79 # classifier_gnb = naive_bayes.GaussianNB() # initiating the classifier - Y_pred = clf.fit(X[:n_samples], Y[:n_samples]) # train on first n_samples and test on last 10 + clf.fit(X[:n_samples], Y[:n_samples]) # train on first n_samples and test on last 10 expected = Y[n_samples:] predicted = clf.predict(X[n_samples:]) @@ -129,7 +134,7 @@ def classificationOutput(clf, X, Y): - def classify(cDf): + def splitclassify(cDf): """ Given the dataframe combined with equal fair and unfair apps, classify them @@ -139,6 +144,7 @@ def classify(cDf): featCols.remove('appLabel') features = cDf[list(featCols)].astype('float') + ## Scale the features to a common range min_max_scaler = preprocessing.MinMaxScaler() X = min_max_scaler.fit_transform(features.values) @@ -173,12 +179,79 @@ def classify(cDf): # print fairDf.values, unfairDf.values print "Classifying %d th split of fair apps with unfair app" % (i) print "-" * 79 - classify(clDf) + splitclassify(clDf) print "\n\n" +def performClassification(clf, featVector, labelVector, fold=4): + """ + Perform Classification + """ + + (numrow, numcol) = featVector.shape + + foldsize = int(numrow//fold) + + print "FoldSize: %s" % (foldsize) + + for i in range(fold): + X_test = featVector[i*foldsize:(i+1)*foldsize] + Y_test = labelVector[i*foldsize:(i+1)*foldsize] + + X_train = np.concatenate((featVector[:i*foldsize], featVector[(i+1)*foldsize:])) + Y_train = np.concatenate((labelVector[:i*foldsize], labelVector[(i+1)*foldsize:])) + + print " X_train: %s, Y_train: %s, X_test: %s, Y_test: %s" % (X_train.shape, Y_train.shape, X_test.shape, Y_test.shape) + + print "#### Classifier: \n %s" % (clf) + + + clf.fit(X_train, Y_train) # train on first n_samples and test on last 10 + + expected = Y_test + predicted = clf.predict(X_test) + print "Classification report:\n%s\n" % metrics.classification_report(expected, predicted) + print "\nConfusion matrix:\n%s" % metrics.confusion_matrix(expected, predicted) + + + + +def allClassifier(cDf, models, modelchoice): + """ + Classifier for all apps + """ + + print "Data Size: %s, \t Model Choice: %s" % (cDf.shape, modelchoice) + + cDf = cDf.reindex(np.random.permutation(cDf.index)) # shuffle the dataframe + featCols = set(cDf.columns) + featCols.remove('appLabel') + + features = cDf[list(featCols)].astype('float') + + ## Scale the features to a common range + min_max_scaler = preprocessing.MinMaxScaler() + featVector = min_max_scaler.fit_transform(features.values) #scaled feature vector + + labelVector = cDf['appLabel'].values #label vector + + + if modelchoice == 'all': + for key in models: + if key != 'svm-nl': + classifier = models[key] + performClassification(classifier, featVector, labelVector) + else: + if modelchoice in models and modelchoice != 'svm-nl': + classifier = models[choice] + performClassification(classifier, featVector, labelVector) + else: + print "Incorrect Choice" + + + @@ -187,26 +260,23 @@ def main(): # Supported classifier models n_neighbors = 3 models = { - 'nb' : naive_bayes.GaussianNB(), - 'svm-l' : svm.SVC(), - 'svm-nl' : svm.NuSVC(), - 'tree' : tree.DecisionTreeClassifier(), - 'forest': AdaBoostClassifier(tree.DecisionTreeClassifier(max_depth=1),algorithm="SAMME",n_estimators=200), - 'knn-uniform' : neighbors.KNeighborsClassifier(n_neighbors, weights='uniform'), - 'knn-distance' : neighbors.KNeighborsClassifier(n_neighbors, weights='distance') + 'nb' : naive_bayes.GaussianNB(), + 'svm-l' : svm.SVC(), + 'svm-nl' : svm.NuSVC(), + 'tree' : tree.DecisionTreeClassifier(), + 'forest': AdaBoostClassifier(tree.DecisionTreeClassifier(max_depth=1),algorithm="SAMME",n_estimators=200), + 'knn-uniform' : neighbors.KNeighborsClassifier(n_neighbors, weights='uniform'), + 'knn-distance' : neighbors.KNeighborsClassifier(n_neighbors, weights='distance') } userInput = getUserInput(models) appDf = loadAppData(userInput['file']) appDf = trimDf(appDf) - - # print "Sample Data" - # print "-" * 79 - # print appDf.head() - - - prepareClassifier(appDf, models, userInput['classifier']) + if userInput['sample'] == 'all': + allClassifier(appDf, models, userInput['classifier']) + else: + prepareSplitClassifier(appDf, models, userInput['classifier']) diff --git a/classifier.py b/classifier.py index df5e27c..b8d3a7d 100644 --- a/classifier.py +++ b/classifier.py @@ -375,7 +375,7 @@ def classifier(alldata, fold=4): # pprint(data) claccuracy = [] - size = int(math.floor(len(data) / 10.0)) + size = int(math.floor(len(data) / fold)) for i in range(fold): test_this_round = data[i*size:][:size] diff --git a/docs/classifier_benchmark.md b/docs/classifier_benchmark.md index 8bd860f..634df9e 100644 --- a/docs/classifier_benchmark.md +++ b/docs/classifier_benchmark.md @@ -9,16 +9,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 0.40 0.44 5 - True 0.50 0.60 0.55 5 + False 0.50 0.67 0.57 3 + True 0.83 0.71 0.77 7 -avg / total 0.50 0.50 0.49 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[2 3] - [2 3]] +[[2 1] + [2 5]] Classifier: @@ -28,16 +28,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 0.40 0.44 5 - True 0.50 0.60 0.55 5 + False 0.50 0.67 0.57 3 + True 0.83 0.71 0.77 7 -avg / total 0.50 0.50 0.49 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[2 3] - [2 3]] +[[2 1] + [2 5]] Classifier: @@ -46,16 +46,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.60 0.60 0.60 5 - True 0.60 0.60 0.60 5 + False 0.60 1.00 0.75 3 + True 1.00 0.71 0.83 7 -avg / total 0.60 0.60 0.60 10 +avg / total 0.88 0.80 0.81 10 Confusion matrix: -[[3 2] - [2 3]] +[[3 0] + [2 5]] Classifier: @@ -67,16 +67,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 0.60 0.55 5 - True 0.50 0.40 0.44 5 + False 0.40 0.67 0.50 3 + True 0.80 0.57 0.67 7 -avg / total 0.50 0.50 0.49 10 +avg / total 0.68 0.60 0.62 10 Confusion matrix: -[[3 2] - [3 2]] +[[2 1] + [3 4]] Classifier: @@ -87,16 +87,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.40 0.50 5 - True 0.57 0.80 0.67 5 + False 0.30 1.00 0.46 3 + True 0.00 0.00 0.00 7 -avg / total 0.62 0.60 0.58 10 +avg / total 0.09 0.30 0.14 10 Confusion matrix: -[[2 3] - [1 4]] +[[3 0] + [7 0]] Classifier: @@ -107,16 +107,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.60 0.60 0.60 5 - True 0.60 0.60 0.60 5 + False 0.50 0.67 0.57 3 + True 0.83 0.71 0.77 7 -avg / total 0.60 0.60 0.60 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[3 2] - [2 3]] +[[2 1] + [2 5]] Classifier: @@ -136,16 +136,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.60 0.60 0.60 5 - True 0.60 0.60 0.60 5 + False 0.43 1.00 0.60 3 + True 1.00 0.43 0.60 7 -avg / total 0.60 0.60 0.60 10 +avg / total 0.83 0.60 0.60 10 Confusion matrix: -[[3 2] - [2 3]] +[[3 0] + [4 3]] @@ -160,16 +160,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.86 0.75 0.80 8 - True 0.33 0.50 0.40 2 + False 0.83 0.83 0.83 6 + True 0.75 0.75 0.75 4 -avg / total 0.75 0.70 0.72 10 +avg / total 0.80 0.80 0.80 10 Confusion matrix: -[[6 2] - [1 1]] +[[5 1] + [1 3]] Classifier: @@ -179,16 +179,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.88 0.88 0.88 8 - True 0.50 0.50 0.50 2 + False 0.83 0.83 0.83 6 + True 0.75 0.75 0.75 4 avg / total 0.80 0.80 0.80 10 Confusion matrix: -[[7 1] - [1 1]] +[[5 1] + [1 3]] Classifier: @@ -197,16 +197,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.80 1.00 0.89 8 - True 0.00 0.00 0.00 2 + False 0.75 1.00 0.86 6 + True 1.00 0.50 0.67 4 -avg / total 0.64 0.80 0.71 10 +avg / total 0.85 0.80 0.78 10 Confusion matrix: -[[8 0] - [2 0]] +[[6 0] + [2 2]] Classifier: @@ -218,16 +218,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.50 0.57 8 - True 0.00 0.00 0.00 2 + False 0.75 0.50 0.60 6 + True 0.50 0.75 0.60 4 -avg / total 0.53 0.40 0.46 10 +avg / total 0.65 0.60 0.60 10 Confusion matrix: -[[4 4] - [2 0]] +[[3 3] + [1 3]] Classifier: @@ -238,16 +238,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.00 0.00 0.00 8 - True 0.20 1.00 0.33 2 + False 0.00 0.00 0.00 6 + True 0.40 1.00 0.57 4 -avg / total 0.04 0.20 0.07 10 +avg / total 0.16 0.40 0.23 10 Confusion matrix: -[[0 8] - [0 2]] +[[0 6] + [0 4]] Classifier: @@ -258,16 +258,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.88 0.88 0.88 8 - True 0.50 0.50 0.50 2 + False 0.83 0.83 0.83 6 + True 0.75 0.75 0.75 4 avg / total 0.80 0.80 0.80 10 Confusion matrix: -[[7 1] - [1 1]] +[[5 1] + [1 3]] Classifier: @@ -287,16 +287,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.86 0.75 0.80 8 - True 0.33 0.50 0.40 2 + False 0.50 0.67 0.57 6 + True 0.00 0.00 0.00 4 -avg / total 0.75 0.70 0.72 10 +avg / total 0.30 0.40 0.34 10 Confusion matrix: -[[6 2] - [1 1]] +[[4 2] + [4 0]] @@ -311,16 +311,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.80 0.73 5 - True 0.75 0.60 0.67 5 + False 0.57 0.80 0.67 5 + True 0.67 0.40 0.50 5 -avg / total 0.71 0.70 0.70 10 +avg / total 0.62 0.60 0.58 10 Confusion matrix: [[4 1] - [2 3]] + [3 2]] Classifier: @@ -330,16 +330,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.80 0.73 5 - True 0.75 0.60 0.67 5 + False 0.57 0.80 0.67 5 + True 0.67 0.40 0.50 5 -avg / total 0.71 0.70 0.70 10 +avg / total 0.62 0.60 0.58 10 Confusion matrix: [[4 1] - [2 3]] + [3 2]] Classifier: @@ -348,16 +348,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.43 0.60 0.50 5 - True 0.33 0.20 0.25 5 + False 0.50 1.00 0.67 5 + True 0.00 0.00 0.00 5 -avg / total 0.38 0.40 0.38 10 +avg / total 0.25 0.50 0.33 10 Confusion matrix: -[[3 2] - [4 1]] +[[5 0] + [5 0]] Classifier: @@ -369,16 +369,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.33 0.40 0.36 5 - True 0.25 0.20 0.22 5 + False 0.75 0.60 0.67 5 + True 0.67 0.80 0.73 5 -avg / total 0.29 0.30 0.29 10 +avg / total 0.71 0.70 0.70 10 Confusion matrix: -[[2 3] - [4 1]] +[[3 2] + [1 4]] Classifier: @@ -389,15 +389,15 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 0.20 0.29 5 - True 0.50 0.80 0.62 5 + False 0.67 0.40 0.50 5 + True 0.57 0.80 0.67 5 -avg / total 0.50 0.50 0.45 10 +avg / total 0.62 0.60 0.58 10 Confusion matrix: -[[1 4] +[[2 3] [1 4]] @@ -409,15 +409,15 @@ Classifier: Classification report: precision recall f1-score support - False 0.60 0.60 0.60 5 - True 0.60 0.60 0.60 5 + False 0.67 0.80 0.73 5 + True 0.75 0.60 0.67 5 -avg / total 0.60 0.60 0.60 10 +avg / total 0.71 0.70 0.70 10 Confusion matrix: -[[3 2] +[[4 1] [2 3]] @@ -438,16 +438,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.33 0.40 0.36 5 - True 0.25 0.20 0.22 5 + False 0.67 0.40 0.50 5 + True 0.57 0.80 0.67 5 -avg / total 0.29 0.30 0.29 10 +avg / total 0.62 0.60 0.58 10 Confusion matrix: [[2 3] - [4 1]] + [1 4]] @@ -462,16 +462,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.80 0.80 0.80 5 - True 0.80 0.80 0.80 5 + False 0.60 0.60 0.60 5 + True 0.60 0.60 0.60 5 -avg / total 0.80 0.80 0.80 10 +avg / total 0.60 0.60 0.60 10 Confusion matrix: -[[4 1] - [1 4]] +[[3 2] + [2 3]] Classifier: @@ -481,16 +481,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.80 0.80 0.80 5 - True 0.80 0.80 0.80 5 + False 0.67 0.80 0.73 5 + True 0.75 0.60 0.67 5 -avg / total 0.80 0.80 0.80 10 +avg / total 0.71 0.70 0.70 10 Confusion matrix: [[4 1] - [1 4]] + [2 3]] Classifier: @@ -499,16 +499,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.62 1.00 0.77 5 - True 1.00 0.40 0.57 5 + False 0.56 1.00 0.71 5 + True 1.00 0.20 0.33 5 -avg / total 0.81 0.70 0.67 10 +avg / total 0.78 0.60 0.52 10 Confusion matrix: [[5 0] - [3 2]] + [4 1]] Classifier: @@ -520,16 +520,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.60 0.60 0.60 5 - True 0.60 0.60 0.60 5 + False 0.50 0.60 0.55 5 + True 0.50 0.40 0.44 5 -avg / total 0.60 0.60 0.60 10 +avg / total 0.50 0.50 0.49 10 Confusion matrix: [[3 2] - [2 3]] + [3 2]] Classifier: @@ -540,16 +540,16 @@ Classifier: Classification report: precision recall f1-score support - False 1.00 0.40 0.57 5 - True 0.62 1.00 0.77 5 + False 0.50 0.60 0.55 5 + True 0.50 0.40 0.44 5 -avg / total 0.81 0.70 0.67 10 +avg / total 0.50 0.50 0.49 10 Confusion matrix: -[[2 3] - [0 5]] +[[3 2] + [3 2]] Classifier: @@ -560,16 +560,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.75 0.60 0.67 5 - True 0.67 0.80 0.73 5 + False 0.67 0.80 0.73 5 + True 0.75 0.60 0.67 5 avg / total 0.71 0.70 0.70 10 Confusion matrix: -[[3 2] - [1 4]] +[[4 1] + [2 3]] Classifier: @@ -589,16 +589,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.40 0.40 0.40 5 - True 0.40 0.40 0.40 5 + False 0.50 0.40 0.44 5 + True 0.50 0.60 0.55 5 -avg / total 0.40 0.40 0.40 10 +avg / total 0.50 0.50 0.49 10 Confusion matrix: [[2 3] - [3 2]] + [2 3]] @@ -613,16 +613,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.80 0.57 0.67 7 - True 0.40 0.67 0.50 3 + False 0.38 1.00 0.55 3 + True 1.00 0.29 0.44 7 -avg / total 0.68 0.60 0.62 10 +avg / total 0.81 0.50 0.47 10 Confusion matrix: -[[4 3] - [1 2]] +[[3 0] + [5 2]] Classifier: @@ -632,16 +632,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.80 0.57 0.67 7 - True 0.40 0.67 0.50 3 + False 0.43 1.00 0.60 3 + True 1.00 0.43 0.60 7 -avg / total 0.68 0.60 0.62 10 +avg / total 0.83 0.60 0.60 10 Confusion matrix: -[[4 3] - [1 2]] +[[3 0] + [4 3]] Classifier: @@ -650,16 +650,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.78 1.00 0.88 7 - True 1.00 0.33 0.50 3 + False 0.43 1.00 0.60 3 + True 1.00 0.43 0.60 7 -avg / total 0.84 0.80 0.76 10 +avg / total 0.83 0.60 0.60 10 Confusion matrix: -[[7 0] - [2 1]] +[[3 0] + [4 3]] Classifier: @@ -671,16 +671,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.75 0.43 0.55 7 - True 0.33 0.67 0.44 3 + False 0.40 0.67 0.50 3 + True 0.80 0.57 0.67 7 -avg / total 0.62 0.50 0.52 10 +avg / total 0.68 0.60 0.62 10 Confusion matrix: -[[3 4] - [1 2]] +[[2 1] + [3 4]] Classifier: @@ -691,16 +691,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.00 0.00 0.00 7 - True 0.22 0.67 0.33 3 + False 0.30 1.00 0.46 3 + True 0.00 0.00 0.00 7 -avg / total 0.07 0.20 0.10 10 +avg / total 0.09 0.30 0.14 10 Confusion matrix: -[[0 7] - [1 2]] +[[3 0] + [7 0]] Classifier: @@ -711,16 +711,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.29 0.40 7 - True 0.29 0.67 0.40 3 + False 0.43 1.00 0.60 3 + True 1.00 0.43 0.60 7 -avg / total 0.55 0.40 0.40 10 +avg / total 0.83 0.60 0.60 10 Confusion matrix: -[[2 5] - [1 2]] +[[3 0] + [4 3]] Classifier: @@ -740,16 +740,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.80 0.57 0.67 7 - True 0.40 0.67 0.50 3 + False 0.38 1.00 0.55 3 + True 1.00 0.29 0.44 7 -avg / total 0.68 0.60 0.62 10 +avg / total 0.81 0.50 0.47 10 Confusion matrix: -[[4 3] - [1 2]] +[[3 0] + [5 2]] @@ -764,16 +764,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.57 0.80 0.67 5 - True 0.67 0.40 0.50 5 + False 0.83 0.71 0.77 7 + True 0.50 0.67 0.57 3 -avg / total 0.62 0.60 0.58 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[4 1] - [3 2]] +[[5 2] + [1 2]] Classifier: @@ -783,16 +783,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.57 0.80 0.67 5 - True 0.67 0.40 0.50 5 + False 0.86 0.86 0.86 7 + True 0.67 0.67 0.67 3 -avg / total 0.62 0.60 0.58 10 +avg / total 0.80 0.80 0.80 10 Confusion matrix: -[[4 1] - [3 2]] +[[6 1] + [1 2]] Classifier: @@ -801,16 +801,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 1.00 0.67 5 - True 0.00 0.00 0.00 5 + False 0.75 0.86 0.80 7 + True 0.50 0.33 0.40 3 -avg / total 0.25 0.50 0.33 10 +avg / total 0.68 0.70 0.68 10 Confusion matrix: -[[5 0] - [5 0]] +[[6 1] + [2 1]] Classifier: @@ -822,16 +822,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.75 0.60 0.67 5 - True 0.67 0.80 0.73 5 + False 1.00 0.29 0.44 7 + True 0.38 1.00 0.55 3 -avg / total 0.71 0.70 0.70 10 +avg / total 0.81 0.50 0.47 10 Confusion matrix: -[[3 2] - [1 4]] +[[2 5] + [0 3]] Classifier: @@ -842,16 +842,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.60 0.60 0.60 5 - True 0.60 0.60 0.60 5 + False 0.00 0.00 0.00 7 + True 0.30 1.00 0.46 3 -avg / total 0.60 0.60 0.60 10 +avg / total 0.09 0.30 0.14 10 Confusion matrix: -[[3 2] - [2 3]] +[[0 7] + [0 3]] Classifier: @@ -862,16 +862,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.80 0.73 5 - True 0.75 0.60 0.67 5 + False 0.75 0.43 0.55 7 + True 0.33 0.67 0.44 3 -avg / total 0.71 0.70 0.70 10 +avg / total 0.62 0.50 0.52 10 Confusion matrix: -[[4 1] - [2 3]] +[[3 4] + [1 2]] Classifier: @@ -891,16 +891,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.75 0.60 0.67 5 - True 0.67 0.80 0.73 5 + False 1.00 0.43 0.60 7 + True 0.43 1.00 0.60 3 -avg / total 0.71 0.70 0.70 10 +avg / total 0.83 0.60 0.60 10 Confusion matrix: -[[3 2] - [1 4]] +[[3 4] + [0 3]] @@ -915,16 +915,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.83 0.83 0.83 6 - True 0.75 0.75 0.75 4 + False 0.57 1.00 0.73 4 + True 1.00 0.50 0.67 6 -avg / total 0.80 0.80 0.80 10 +avg / total 0.83 0.70 0.69 10 Confusion matrix: -[[5 1] - [1 3]] +[[4 0] + [3 3]] Classifier: @@ -934,16 +934,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.83 0.83 0.83 6 - True 0.75 0.75 0.75 4 + False 0.57 1.00 0.73 4 + True 1.00 0.50 0.67 6 -avg / total 0.80 0.80 0.80 10 +avg / total 0.83 0.70 0.69 10 Confusion matrix: -[[5 1] - [1 3]] +[[4 0] + [3 3]] Classifier: @@ -952,16 +952,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 1.00 0.80 6 - True 1.00 0.25 0.40 4 + False 0.57 1.00 0.73 4 + True 1.00 0.50 0.67 6 -avg / total 0.80 0.70 0.64 10 +avg / total 0.83 0.70 0.69 10 Confusion matrix: -[[6 0] - [3 1]] +[[4 0] + [3 3]] Classifier: @@ -973,16 +973,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.33 0.44 6 - True 0.43 0.75 0.55 4 + False 0.38 0.75 0.50 4 + True 0.50 0.17 0.25 6 -avg / total 0.57 0.50 0.48 10 +avg / total 0.45 0.40 0.35 10 Confusion matrix: -[[2 4] - [1 3]] +[[3 1] + [5 1]] Classifier: @@ -993,16 +993,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.00 0.00 0.00 6 - True 0.40 1.00 0.57 4 + False 0.40 1.00 0.57 4 + True 0.00 0.00 0.00 6 avg / total 0.16 0.40 0.23 10 Confusion matrix: -[[0 6] - [0 4]] +[[4 0] + [6 0]] Classifier: @@ -1013,16 +1013,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.75 1.00 0.86 6 - True 1.00 0.50 0.67 4 + False 0.60 0.75 0.67 4 + True 0.80 0.67 0.73 6 -avg / total 0.85 0.80 0.78 10 +avg / total 0.72 0.70 0.70 10 Confusion matrix: -[[6 0] - [2 2]] +[[3 1] + [2 4]] Classifier: @@ -1042,16 +1042,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.60 0.50 0.55 6 - True 0.40 0.50 0.44 4 + False 0.50 1.00 0.67 4 + True 1.00 0.33 0.50 6 -avg / total 0.52 0.50 0.51 10 +avg / total 0.80 0.60 0.57 10 Confusion matrix: -[[3 3] - [2 2]] +[[4 0] + [4 2]] @@ -1066,16 +1066,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 1.00 0.67 4 - True 1.00 0.33 0.50 6 + False 0.43 0.60 0.50 5 + True 0.33 0.20 0.25 5 -avg / total 0.80 0.60 0.57 10 +avg / total 0.38 0.40 0.38 10 Confusion matrix: -[[4 0] - [4 2]] +[[3 2] + [4 1]] Classifier: @@ -1085,16 +1085,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.57 1.00 0.73 4 - True 1.00 0.50 0.67 6 + False 0.44 0.80 0.57 5 + True 0.00 0.00 0.00 5 -avg / total 0.83 0.70 0.69 10 +avg / total 0.22 0.40 0.29 10 Confusion matrix: -[[4 0] - [3 3]] +[[4 1] + [5 0]] Classifier: @@ -1103,16 +1103,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.40 1.00 0.57 4 - True 0.00 0.00 0.00 6 + False 0.33 0.40 0.36 5 + True 0.25 0.20 0.22 5 -avg / total 0.16 0.40 0.23 10 +avg / total 0.29 0.30 0.29 10 Confusion matrix: -[[4 0] - [6 0]] +[[2 3] + [4 1]] Classifier: @@ -1124,16 +1124,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.40 0.50 0.44 4 - True 0.60 0.50 0.55 6 + False 0.33 0.20 0.25 5 + True 0.43 0.60 0.50 5 -avg / total 0.52 0.50 0.51 10 +avg / total 0.38 0.40 0.38 10 Confusion matrix: -[[2 2] - [3 3]] +[[1 4] + [2 3]] Classifier: @@ -1144,16 +1144,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.40 1.00 0.57 4 - True 0.00 0.00 0.00 6 + False 0.50 0.80 0.62 5 + True 0.50 0.20 0.29 5 -avg / total 0.16 0.40 0.23 10 +avg / total 0.50 0.50 0.45 10 Confusion matrix: -[[4 0] - [6 0]] +[[4 1] + [4 1]] Classifier: @@ -1164,16 +1164,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.38 0.75 0.50 4 - True 0.50 0.17 0.25 6 + False 0.33 0.40 0.36 5 + True 0.25 0.20 0.22 5 -avg / total 0.45 0.40 0.35 10 +avg / total 0.29 0.30 0.29 10 Confusion matrix: -[[3 1] - [5 1]] +[[2 3] + [4 1]] Classifier: @@ -1193,16 +1193,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.38 0.75 0.50 4 - True 0.50 0.17 0.25 6 + False 0.57 0.80 0.67 5 + True 0.67 0.40 0.50 5 -avg / total 0.45 0.40 0.35 10 +avg / total 0.62 0.60 0.58 10 Confusion matrix: -[[3 1] - [5 1]] +[[4 1] + [3 2]] @@ -1217,16 +1217,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.17 0.50 0.25 2 - True 0.75 0.38 0.50 8 + False 0.71 0.71 0.71 7 + True 0.33 0.33 0.33 3 -avg / total 0.63 0.40 0.45 10 +avg / total 0.60 0.60 0.60 10 Confusion matrix: -[[1 1] - [5 3]] +[[5 2] + [2 1]] Classifier: @@ -1236,16 +1236,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.17 0.50 0.25 2 - True 0.75 0.38 0.50 8 + False 0.83 0.71 0.77 7 + True 0.50 0.67 0.57 3 -avg / total 0.63 0.40 0.45 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[1 1] - [5 3]] +[[5 2] + [1 2]] Classifier: @@ -1254,16 +1254,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.17 0.50 0.25 2 - True 0.75 0.38 0.50 8 + False 0.78 1.00 0.88 7 + True 1.00 0.33 0.50 3 -avg / total 0.63 0.40 0.45 10 +avg / total 0.84 0.80 0.76 10 Confusion matrix: -[[1 1] - [5 3]] +[[7 0] + [2 1]] Classifier: @@ -1275,16 +1275,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.12 0.50 0.20 2 - True 0.50 0.12 0.20 8 + False 0.75 0.43 0.55 7 + True 0.33 0.67 0.44 3 -avg / total 0.42 0.20 0.20 10 +avg / total 0.62 0.50 0.52 10 Confusion matrix: -[[1 1] - [7 1]] +[[3 4] + [1 2]] Classifier: @@ -1295,16 +1295,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.20 1.00 0.33 2 - True 0.00 0.00 0.00 8 + False 0.00 0.00 0.00 7 + True 0.30 1.00 0.46 3 -avg / total 0.04 0.20 0.07 10 +avg / total 0.09 0.30 0.14 10 Confusion matrix: -[[2 0] - [8 0]] +[[0 7] + [0 3]] Classifier: @@ -1315,16 +1315,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.14 0.50 0.22 2 - True 0.67 0.25 0.36 8 + False 0.86 0.86 0.86 7 + True 0.67 0.67 0.67 3 -avg / total 0.56 0.30 0.34 10 +avg / total 0.80 0.80 0.80 10 Confusion matrix: -[[1 1] - [6 2]] +[[6 1] + [1 2]] Classifier: @@ -1344,16 +1344,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.14 0.50 0.22 2 - True 0.67 0.25 0.36 8 + False 0.60 0.43 0.50 7 + True 0.20 0.33 0.25 3 -avg / total 0.56 0.30 0.34 10 +avg / total 0.48 0.40 0.42 10 Confusion matrix: -[[1 1] - [6 2]] +[[3 4] + [2 1]] @@ -1368,16 +1368,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.80 0.73 5 - True 0.75 0.60 0.67 5 + False 0.83 0.71 0.77 7 + True 0.50 0.67 0.57 3 -avg / total 0.71 0.70 0.70 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[4 1] - [2 3]] +[[5 2] + [1 2]] Classifier: @@ -1387,16 +1387,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.80 0.73 5 - True 0.75 0.60 0.67 5 + False 0.83 0.71 0.77 7 + True 0.50 0.67 0.57 3 -avg / total 0.71 0.70 0.70 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[4 1] - [2 3]] +[[5 2] + [1 2]] Classifier: @@ -1405,16 +1405,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.56 1.00 0.71 5 - True 1.00 0.20 0.33 5 + False 0.78 1.00 0.88 7 + True 1.00 0.33 0.50 3 -avg / total 0.78 0.60 0.52 10 +avg / total 0.84 0.80 0.76 10 Confusion matrix: -[[5 0] - [4 1]] +[[7 0] + [2 1]] Classifier: @@ -1426,16 +1426,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.44 0.80 0.57 5 - True 0.00 0.00 0.00 5 + False 0.83 0.71 0.77 7 + True 0.50 0.67 0.57 3 -avg / total 0.22 0.40 0.29 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[4 1] - [5 0]] +[[5 2] + [1 2]] Classifier: @@ -1446,16 +1446,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 1.00 0.67 5 - True 0.00 0.00 0.00 5 + False 0.00 0.00 0.00 7 + True 0.30 1.00 0.46 3 -avg / total 0.25 0.50 0.33 10 +avg / total 0.09 0.30 0.14 10 Confusion matrix: -[[5 0] - [5 0]] +[[0 7] + [0 3]] Classifier: @@ -1466,16 +1466,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.56 1.00 0.71 5 - True 1.00 0.20 0.33 5 + False 0.83 0.71 0.77 7 + True 0.50 0.67 0.57 3 -avg / total 0.78 0.60 0.52 10 +avg / total 0.73 0.70 0.71 10 Confusion matrix: -[[5 0] - [4 1]] +[[5 2] + [1 2]] Classifier: @@ -1495,16 +1495,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 1.00 0.67 5 - True 0.00 0.00 0.00 5 + False 0.80 0.57 0.67 7 + True 0.40 0.67 0.50 3 -avg / total 0.25 0.50 0.33 10 +avg / total 0.68 0.60 0.62 10 Confusion matrix: -[[5 0] - [5 0]] +[[4 3] + [1 2]] @@ -1519,16 +1519,16 @@ Classifier: Classification report: precision recall f1-score support - False 1.00 0.56 0.71 9 - True 0.20 1.00 0.33 1 + False 0.57 0.80 0.67 5 + True 0.67 0.40 0.50 5 -avg / total 0.92 0.60 0.68 10 +avg / total 0.62 0.60 0.58 10 Confusion matrix: -[[5 4] - [0 1]] +[[4 1] + [3 2]] Classifier: @@ -1538,16 +1538,16 @@ Classifier: Classification report: precision recall f1-score support - False 1.00 0.67 0.80 9 - True 0.25 1.00 0.40 1 + False 0.57 0.80 0.67 5 + True 0.67 0.40 0.50 5 -avg / total 0.93 0.70 0.76 10 +avg / total 0.62 0.60 0.58 10 Confusion matrix: -[[6 3] - [0 1]] +[[4 1] + [3 2]] Classifier: @@ -1556,16 +1556,16 @@ Classifier: Classification report: precision recall f1-score support - False 1.00 0.78 0.88 9 - True 0.33 1.00 0.50 1 + False 0.56 1.00 0.71 5 + True 1.00 0.20 0.33 5 -avg / total 0.93 0.80 0.84 10 +avg / total 0.78 0.60 0.52 10 Confusion matrix: -[[7 2] - [0 1]] +[[5 0] + [4 1]] Classifier: @@ -1577,16 +1577,16 @@ Classifier: Classification report: precision recall f1-score support - False 1.00 0.22 0.36 9 - True 0.12 1.00 0.22 1 + False 0.67 0.40 0.50 5 + True 0.57 0.80 0.67 5 -avg / total 0.91 0.30 0.35 10 +avg / total 0.62 0.60 0.58 10 Confusion matrix: -[[2 7] - [0 1]] +[[2 3] + [1 4]] Classifier: @@ -1597,16 +1597,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.00 0.00 0.00 9 - True 0.10 1.00 0.18 1 + False 0.67 0.80 0.73 5 + True 0.75 0.60 0.67 5 -avg / total 0.01 0.10 0.02 10 +avg / total 0.71 0.70 0.70 10 Confusion matrix: -[[0 9] - [0 1]] +[[4 1] + [2 3]] Classifier: @@ -1617,16 +1617,16 @@ Classifier: Classification report: precision recall f1-score support - False 1.00 0.44 0.62 9 - True 0.17 1.00 0.29 1 + False 0.50 0.60 0.55 5 + True 0.50 0.40 0.44 5 -avg / total 0.92 0.50 0.58 10 +avg / total 0.50 0.50 0.49 10 Confusion matrix: -[[4 5] - [0 1]] +[[3 2] + [3 2]] Classifier: @@ -1646,16 +1646,16 @@ Classifier: Classification report: precision recall f1-score support - False 1.00 0.11 0.20 9 - True 0.11 1.00 0.20 1 + False 0.50 0.20 0.29 5 + True 0.50 0.80 0.62 5 -avg / total 0.91 0.20 0.20 10 +avg / total 0.50 0.50 0.45 10 Confusion matrix: -[[1 8] - [0 1]] +[[1 4] + [1 4]] @@ -1670,16 +1670,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.33 0.50 0.40 4 - True 0.50 0.33 0.40 6 + False 0.60 0.75 0.67 4 + True 0.80 0.67 0.73 6 -avg / total 0.43 0.40 0.40 10 +avg / total 0.72 0.70 0.70 10 Confusion matrix: -[[2 2] - [4 2]] +[[3 1] + [2 4]] Classifier: @@ -1689,16 +1689,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.44 1.00 0.62 4 - True 1.00 0.17 0.29 6 + False 0.60 0.75 0.67 4 + True 0.80 0.67 0.73 6 -avg / total 0.78 0.50 0.42 10 +avg / total 0.72 0.70 0.70 10 Confusion matrix: -[[4 0] - [5 1]] +[[3 1] + [2 4]] Classifier: @@ -1707,15 +1707,15 @@ Classifier: Classification report: precision recall f1-score support - False 0.38 0.75 0.50 4 - True 0.50 0.17 0.25 6 + False 0.44 1.00 0.62 4 + True 1.00 0.17 0.29 6 -avg / total 0.45 0.40 0.35 10 +avg / total 0.78 0.50 0.42 10 Confusion matrix: -[[3 1] +[[4 0] [5 1]] @@ -1728,16 +1728,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.29 0.50 0.36 4 - True 0.33 0.17 0.22 6 + False 0.33 0.50 0.40 4 + True 0.50 0.33 0.40 6 -avg / total 0.31 0.30 0.28 10 +avg / total 0.43 0.40 0.40 10 Confusion matrix: [[2 2] - [5 1]] + [4 2]] Classifier: @@ -1768,16 +1768,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.38 0.75 0.50 4 - True 0.50 0.17 0.25 6 + False 0.43 0.75 0.55 4 + True 0.67 0.33 0.44 6 -avg / total 0.45 0.40 0.35 10 +avg / total 0.57 0.50 0.48 10 Confusion matrix: [[3 1] - [5 1]] + [4 2]] Classifier: @@ -1797,16 +1797,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.29 0.50 0.36 4 - True 0.33 0.17 0.22 6 + False 0.33 0.50 0.40 4 + True 0.50 0.33 0.40 6 -avg / total 0.31 0.30 0.28 10 +avg / total 0.43 0.40 0.40 10 Confusion matrix: [[2 2] - [5 1]] + [4 2]] @@ -1821,16 +1821,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.67 0.67 6 - True 0.50 0.50 0.50 4 + False 0.50 0.50 0.50 4 + True 0.67 0.67 0.67 6 avg / total 0.60 0.60 0.60 10 Confusion matrix: -[[4 2] - [2 2]] +[[2 2] + [2 4]] Classifier: @@ -1840,16 +1840,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 0.67 0.67 6 - True 0.50 0.50 0.50 4 + False 0.60 0.75 0.67 4 + True 0.80 0.67 0.73 6 -avg / total 0.60 0.60 0.60 10 +avg / total 0.72 0.70 0.70 10 Confusion matrix: -[[4 2] - [2 2]] +[[3 1] + [2 4]] Classifier: @@ -1858,16 +1858,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.56 0.83 0.67 6 - True 0.00 0.00 0.00 4 + False 0.50 0.75 0.60 4 + True 0.75 0.50 0.60 6 -avg / total 0.33 0.50 0.40 10 +avg / total 0.65 0.60 0.60 10 Confusion matrix: -[[5 1] - [4 0]] +[[3 1] + [3 3]] Classifier: @@ -1879,16 +1879,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.62 0.83 0.71 6 - True 0.50 0.25 0.33 4 + False 0.33 0.50 0.40 4 + True 0.50 0.33 0.40 6 -avg / total 0.57 0.60 0.56 10 +avg / total 0.43 0.40 0.40 10 Confusion matrix: -[[5 1] - [3 1]] +[[2 2] + [4 2]] Classifier: @@ -1899,16 +1899,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.00 0.00 0.00 6 - True 0.40 1.00 0.57 4 + False 0.40 1.00 0.57 4 + True 0.00 0.00 0.00 6 avg / total 0.16 0.40 0.23 10 Confusion matrix: -[[0 6] - [0 4]] +[[4 0] + [6 0]] Classifier: @@ -1919,16 +1919,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.50 0.67 0.57 6 - True 0.00 0.00 0.00 4 + False 0.67 1.00 0.80 4 + True 1.00 0.67 0.80 6 -avg / total 0.30 0.40 0.34 10 +avg / total 0.87 0.80 0.80 10 Confusion matrix: -[[4 2] - [4 0]] +[[4 0] + [2 4]] Classifier: @@ -1948,16 +1948,16 @@ Classifier: Classification report: precision recall f1-score support - False 0.67 1.00 0.80 6 - True 1.00 0.25 0.40 4 + False 0.50 0.50 0.50 4 + True 0.67 0.67 0.67 6 -avg / total 0.80 0.70 0.64 10 +avg / total 0.60 0.60 0.60 10 Confusion matrix: -[[6 0] - [3 1]] +[[2 2] + [2 4]] diff --git a/wiki b/wiki index 1d5be0c..4773c30 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 1d5be0c169c4f48954de0322d44f352176bbe17f +Subproject commit 4773c30f26666d7410bfc8560e2bb0a7b712cb6d