Last active
June 7, 2018 12:13
-
-
Save parksunwoo/4f1f9909ab97a40c0033908c4b501657 to your computer and use it in GitHub Desktop.
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
### SMOTE | |
from imblearn.over_sampling import SMOTE | |
X_resampled, y_resampled = SMOTE().fit_sample(X_train, y_train) | |
### ROC_AUC_SCORE | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.metrics import roc_auc_score | |
logreg = LogisticRegression() | |
logreg.fit(X_train, y_train) | |
y_pred = logreg.predict_proba(X_test_set)[:,1] | |
roc_auc_score(y_test_set, y_pred) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment