Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. # Listing 4
  2. np.random.seed(2)
  3. x1=np.arange(1,10001)
  4. y1=np.zeros(10000)
  5. y1[5000:10000]=1
  6.  
  7. prob = predict_proba(x1)
  8. fpr, tpr, threshold = roc_curve(y1, prob)
  9.  
  10. plt.plot(fpr, tpr, 'b')
  11. plt.plot([0,1],[0,1], 'r--')
  12. plt.xlabel("False Positive Rate", fontsize=12)
  13. plt.ylabel("True Positive Rate", fontsize=12)
  14.  
  15. plt.savefig('random_classifier_roc_inc.png', dpi=300)
  16. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement