MulaiMulai sekarang secara gratis

Evaluate the AdaBoost classifier

Now that you're done training ada and predicting the probabilities of obtaining the positive class in the test set, it's time to evaluate ada's ROC AUC score. Recall that the ROC AUC score of a binary classifier can be determined using the roc_auc_score() function from sklearn.metrics.

The arrays y_test and y_pred_proba that you computed in the previous exercise are available in your workspace.

Latihan ini adalah bagian dari kursus

Machine Learning with Tree-Based Models in Python

Lihat Kursus

Petunjuk latihan

  • Import roc_auc_score from sklearn.metrics.

  • Compute ada's test set ROC AUC score, assign it to ada_roc_auc, and print it out.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Import roc_auc_score
____

# Evaluate test-set roc_auc_score
____ = ____(____, ____)

# Print roc_auc_score
print('ROC AUC score: {:.2f}'.format(ada_roc_auc))
Edit dan Jalankan Kode