Showing
1 changed file
with
1 additions
and
5 deletions
| ... | @@ -210,15 +210,14 @@ if __name__ == "__main__": | ... | @@ -210,15 +210,14 @@ if __name__ == "__main__": |
| 210 | print(" Done!") | 210 | print(" Done!") |
| 211 | 211 | ||
| 212 | y_pred = myClassifier.predict(X_test) | 212 | y_pred = myClassifier.predict(X_test) |
| 213 | - best_parameters = myClassifier.best_estimator_.get_params() | ||
| 214 | print(" Done!") | 213 | print(" Done!") |
| 215 | 214 | ||
| 216 | print("Saving report...") | 215 | print("Saving report...") |
| 217 | with open(os.path.join(args.outputReportPath, args.outputReportFile), mode='w', encoding='utf8') as oFile: | 216 | with open(os.path.join(args.outputReportPath, args.outputReportFile), mode='w', encoding='utf8') as oFile: |
| 218 | oFile.write('********** EVALUATION REPORT **********\n') | 217 | oFile.write('********** EVALUATION REPORT **********\n') |
| 219 | - oFile.write('Reduction: {}\n'.format(args.reduction)) | ||
| 220 | oFile.write('Classifier: {}\n'.format(args.myClassifier)) | 218 | oFile.write('Classifier: {}\n'.format(args.myClassifier)) |
| 221 | oFile.write('Kernel: {}\n'.format(args.kernel)) | 219 | oFile.write('Kernel: {}\n'.format(args.kernel)) |
| 220 | + oFile.write('Training score: {}\n'.format(myClassifier.score())) | ||
| 222 | oFile.write('Accuracy: {}\n'.format(accuracy_score(y_test, y_pred))) | 221 | oFile.write('Accuracy: {}\n'.format(accuracy_score(y_test, y_pred))) |
| 223 | oFile.write('Precision: {}\n'.format(precision_score(y_test, y_pred, average='weighted'))) | 222 | oFile.write('Precision: {}\n'.format(precision_score(y_test, y_pred, average='weighted'))) |
| 224 | oFile.write('Recall: {}\n'.format(recall_score(y_test, y_pred, average='weighted'))) | 223 | oFile.write('Recall: {}\n'.format(recall_score(y_test, y_pred, average='weighted'))) |
| ... | @@ -227,9 +226,6 @@ if __name__ == "__main__": | ... | @@ -227,9 +226,6 @@ if __name__ == "__main__": |
| 227 | oFile.write(str(confusion_matrix(y_test, y_pred)) + '\n') | 226 | oFile.write(str(confusion_matrix(y_test, y_pred)) + '\n') |
| 228 | oFile.write('Classification report: \n') | 227 | oFile.write('Classification report: \n') |
| 229 | oFile.write(classification_report(y_test, y_pred) + '\n') | 228 | oFile.write(classification_report(y_test, y_pred) + '\n') |
| 230 | - oFile.write('Best parameters: \n') | ||
| 231 | - for param in sorted(best_parameters.keys()): | ||
| 232 | - oFile.write("\t%s: %r\n" % (param, best_parameters[param])) | ||
| 233 | print(" Done!") | 229 | print(" Done!") |
| 234 | 230 | ||
| 235 | print("Training and testing done in: %fs" % (time() - t0)) | 231 | print("Training and testing done in: %fs" % (time() - t0)) | ... | ... |
-
Please register or login to post a comment