Created
June 20, 2020 20:39
-
-
Save sadimanna/e955fffeabf370f0eaa0f382f4e28d65 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
| def prcurve(y,pred): | |
| P = [] | |
| R = [] | |
| thresholds = np.arange(0.0,1.0+0.01,0.01) | |
| for th in thresholds: | |
| P.append(precision(y,pred,th)) | |
| R.append(recall(y,pred,th)) | |
| plt.figure(figsize=(10,10)) | |
| plt.plot(R,P,linewidth=2) | |
| plt.xlim(0.0, 1.0) | |
| plt.ylim(0.0, 1.0) | |
| plt.xlabel("Recall",fontsize=12) | |
| plt.ylabel("Precision",fontsize=12) | |
| plt.legend(fontsize=10, loc='best') | |
| plt.title("Precision Recall Curve",fontsize=12) | |
| plt.savefig('Precision_Recall_Curve.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment