Created
October 13, 2021 17:21
-
-
Save liannewriting/31d2cbb41ba99b86e80c0730822c3f51 to your computer and use it in GitHub Desktop.
python imbalanced data machine learning classification
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 | |
clf = LogisticRegression(random_state=888) | |
clf.fit(X_resampled, y_resampled) | |
y_pred = clf.predict_proba(df_test[features])[:, 1] | |
from sklearn.metrics import roc_auc_score | |
roc_auc_score(df_test['Class'], y_pred) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment