image_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.metrics import make_scorer, roc_auc_score

from sklearn.metrics import roc_auc_score, roc_curve

clf_rf_down = RandomForestClassifier(random_state=42, n_estimators=50)
model_rf_down = clf_rf_down.fit(X_train_sm, y_train_sm)
y_prob = model_rf_down.predict_proba(X_test)[:, 1]
print(f'ROC-AUC score: {roc_auc_score(y_test, y_prob):.3f}')