Created
December 8, 2020 08:07
-
-
Save betterdatascience/85005e4d4705ad13736074af4ba7901d to your computer and use it in GitHub Desktop.
005_roc_auc
This file contains 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.linear_model import LogisticRegression | |
from sklearn.tree import DecisionTreeClassifier | |
from sklearn.ensemble import RandomForestClassifier | |
from xgboost import XGBClassifier | |
model_lr = LogisticRegression().fit(X_train, y_train) | |
probs_lr = model_lr.predict_proba(X_test)[:, 1] | |
model_dt = DecisionTreeClassifier().fit(X_train, y_train) | |
probs_dt = model_dt.predict_proba(X_test)[:, 1] | |
model_rf = RandomForestClassifier().fit(X_train, y_train) | |
probs_rf = model_rf.predict_proba(X_test)[:, 1] | |
model_xg = XGBClassifier().fit(X_train, y_train) | |
probs_xg = model_xg.predict_proba(X_test)[:, 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment