Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a [problem in precision_recall_curve? #99

Open
Cbanyungong opened this issue Dec 13, 2018 · 1 comment
Open

Is there a [problem in precision_recall_curve? #99

Cbanyungong opened this issue Dec 13, 2018 · 1 comment

Comments

@Cbanyungong
Copy link

Dear sir
Thanks for your excellent work in the scikit-plot. I am confused in the function of precision_recall_curve. As we all know,the PR curve goes through two points:(0,1) and(1,0).But I used the test code to draw the curve and found that the curve does not goes the point of (1,0).I used the below code and get the curve.

import scikitplot as skplt
rf = GaussianNB ()
rf = rf.fit(X_train, y_train)
y_pred = rf.predict(X_test)
skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)
plt.show()

@lugq1990
Copy link
Contributor

lugq1990 commented Jan 2, 2019

I'm sorry I can't get your question idea. You want to plot the precision_recall curve, but your code is just using plot_confusion_matrix for confusion matrix. In fact, if you want to use plot_precision_recall_curve, you have to make your prediction probability based on your test data, just like this:
prob = rf.predict_proba(X_test) skplt.metrics.plot_precision_recall_curve(y_test, prob) plt.show()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants