Showing
1 changed file
with
3 additions
and
3 deletions
... | @@ -140,6 +140,7 @@ if __name__ == "__main__": | ... | @@ -140,6 +140,7 @@ if __name__ == "__main__": |
140 | classifier.fit(dataTraining, trueTrainingClasses) | 140 | classifier.fit(dataTraining, trueTrainingClasses) |
141 | print(" Prediction...") | 141 | print(" Prediction...") |
142 | y_pred = classifier.predict(dataEvaluation) | 142 | y_pred = classifier.predict(dataEvaluation) |
143 | + confidence_scores = classifier.decision_function(dataEvaluation) | ||
143 | print(" Training and predition done!") | 144 | print(" Training and predition done!") |
144 | 145 | ||
145 | # for i in range(len(trueClasses)): | 146 | # for i in range(len(trueClasses)): |
... | @@ -162,9 +163,8 @@ if __name__ == "__main__": | ... | @@ -162,9 +163,8 @@ if __name__ == "__main__": |
162 | oFile.write('Classification report: \n') | 163 | oFile.write('Classification report: \n') |
163 | oFile.write(classification_report(trueEvaluationClasses, y_pred) + '\n') | 164 | oFile.write(classification_report(trueEvaluationClasses, y_pred) + '\n') |
164 | if options.classifier == "Perceptron": | 165 | if options.classifier == "Perceptron": |
165 | - oFile.write("Perceptron\n") | 166 | + oFile.write("{}".format(confidence_scores)) |
166 | - for coef in classifier.coefs_: | 167 | + |
167 | - oFile.write("coef.shape: {}\n".format(coef.shape)) | ||
168 | print(" Saving test report done!") | 168 | print(" Saving test report done!") |
169 | 169 | ||
170 | print("Training and test done in: %fs" % (time() - t0)) | 170 | print("Training and test done in: %fs" % (time() - t0)) | ... | ... |
-
Please register or login to post a comment