Skip to content

Instantly share code, notes, and snippets.

@adhadse
Last active March 18, 2021 02:48
Show Gist options
  • Save adhadse/73656d9a334ecacbea59c917770281c0 to your computer and use it in GitHub Desktop.
Save adhadse/73656d9a334ecacbea59c917770281c0 to your computer and use it in GitHub Desktop.
from sklearn.model_selection import cross_val_predict
from sklearn.metrics import precision_recall_curve
# First you need to get the precisions, recalls, thresholds for your classifier.
y_scores = cross_val_predict(classifier, X_train, y_train, cv=3, method='decision_function')
precisions, recalls, thresholds = precision_recall_curve(y_train, y_scores)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment