Created
May 22, 2019 00:34
-
-
Save EdsonAvelar/1598f790cfb42109c43a0acfb6303430 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
| from sklearn.ensemble import RandomForestClassifier | |
| clf = RandomForestClassifier() | |
| clf.fit(X_train, y_train) | |
| y_pred = clf.predict(X_test) | |
| y_pred_probability = clf.predict_proba(X_test)[::,1] | |
| fpr, tpr, _ = metrics.roc_curve(y_test, y_pred_probability) | |
| auc = metrics.roc_auc_score(y_test, y_pred_probability) | |
| plt.plot(fpr,tpr,label="RandomForest, auc="+str(auc)) | |
| plt.legend(loc=4) | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment