Skip to content

Instantly share code, notes, and snippets.

@MercyMarkus
Created April 18, 2019 15:32
Show Gist options
  • Save MercyMarkus/30aecb2bdc33a50c33a74f6796179ce0 to your computer and use it in GitHub Desktop.
Save MercyMarkus/30aecb2bdc33a50c33a74f6796179ce0 to your computer and use it in GitHub Desktop.
from sklearn.metrics import roc_auc_score
def auc_score(y_score,y_true):
return torch.tensor(roc_auc_score(y_true,y_score[:,1]))
probs,val_labels = learn.get_preds(ds_type=DatasetType.Valid)
print('Accuracy',accuracy(probs,val_labels)),
print('Error Rate', error_rate(probs, val_labels))
print('AUC', auc_score(probs,val_labels))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment