Training, crossvalidation and testing binding thrombin dataset
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -234,13 +234,17 @@ if __name__ == "__main__": | ... | @@ -234,13 +234,17 @@ if __name__ == "__main__": |
234 | print(" Done!") | 234 | print(" Done!") |
235 | 235 | ||
236 | print("Testing (prediction in new data)...") | 236 | print("Testing (prediction in new data)...") |
237 | + if args.reduction is not None: | ||
238 | + X_test = reduc.transform(X_test) | ||
237 | y_pred = classifier.predict(X_test) | 239 | y_pred = classifier.predict(X_test) |
238 | print(" Done!") | 240 | print(" Done!") |
239 | 241 | ||
240 | print("Saving report...") | 242 | print("Saving report...") |
241 | with open(os.path.join(args.outputReportPath, args.outputReportFile), mode='w', encoding='utf8') as oFile: | 243 | with open(os.path.join(args.outputReportPath, args.outputReportFile), mode='w', encoding='utf8') as oFile: |
242 | oFile.write('********** EVALUATION REPORT **********\n') | 244 | oFile.write('********** EVALUATION REPORT **********\n') |
245 | + oFile.write('Reduction: {}\n'.format(args.reduction)) | ||
243 | oFile.write('Classifier: {}\n'.format(args.classifier)) | 246 | oFile.write('Classifier: {}\n'.format(args.classifier)) |
247 | + oFile.write('Kernel: {}\n'.format(args.kernel)) | ||
244 | oFile.write('Accuracy: {}\n'.format(accuracy_score(y_test, y_pred))) | 248 | oFile.write('Accuracy: {}\n'.format(accuracy_score(y_test, y_pred))) |
245 | oFile.write('Precision: {}\n'.format(precision_score(y_test, y_pred, average='weighted'))) | 249 | oFile.write('Precision: {}\n'.format(precision_score(y_test, y_pred, average='weighted'))) |
246 | oFile.write('Recall: {}\n'.format(recall_score(y_test, y_pred, average='weighted'))) | 250 | oFile.write('Recall: {}\n'.format(recall_score(y_test, y_pred, average='weighted'))) | ... | ... |
-
Please register or login to post a comment