Skip to content

Instantly share code, notes, and snippets.

@weklund
Created November 11, 2018 14:35
Show Gist options
  • Save weklund/19ef8e56aa7574f1f1ff3bfe299d15fb to your computer and use it in GitHub Desktop.
Save weklund/19ef8e56aa7574f1f1ff3bfe299d15fb to your computer and use it in GitHub Desktop.
submission_inception_resnet = pd.DataFrame({'Id':test_files, 'task_1':test_predictions_task1,'task_2':test_predictions_task2})
pd.DataFrame.to_csv(submission_inception_resnet, 'submission.csv', index=False)
preds_path = sys.argv[1]
thresh = 0.5
# get ground truth labels for test dataset
truth = pd.read_csv('ground_truth.csv')
y_true = truth.as_matrix(columns=["task_1", "task_2"])
# get model predictions for test dataset
y_pred = pd.read_csv('submission.csv')
y_pred = y_pred.as_matrix(columns=["task_1", "task_2"])
# plot ROC curves and print scores
plot_roc_auc(y_true, y_pred)
# plot confusion matrix
classes = ['benign', 'malignant']
plot_confusion_matrix(y_true[:,0], y_pred[:,0], thresh, classes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment