Created
March 6, 2016 20:00
-
-
Save spedy/9306b02b2191d4e3589f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.metrics import precision_recall_curve | |
import matplotlib.pyplot as pl | |
recall, precision, thresholds = precision_recall_curve(np.array(np_y_true), np.array(np_y_scores)) | |
pl.plot(recall, precision) | |
pl.xlabel('Recall') | |
pl.ylabel('Precision') | |
pl.ylim([0.0, 1.05]) | |
pl.xlim([0.0, 1.0]) | |
pl.title('Precision-Recall') | |
pl.savefig("{0}_{1}.png".format(kernel, k)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment