BaşlayınÜcretsiz Başlayın

Assessing gradient boosted trees

So you've now used XGBClassifier() models to predict probability of default. These models can also use the .predict() method for creating predictions that give the actual class for loan_status.

You should check the model's initial performance by looking at the metrics from the classification_report(). Keep in mind that you have not set thresholds for these models yet.

The data sets cr_loan_prep, X_test, and y_test have already been loaded in the workspace. The model clf_gbt has been loaded as well. The classification_report() for the logistic regression will print automatically.

Bu egzersiz

Credit Risk Modeling in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Predict the loan_status values for the X test data and store them in gbt_preds.
  • Check the contents of gbt_preds to see predicted loan_status values not probabilities of default.
  • Print a classification_report() of the model's performance against y_test.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Predict the labels for loan status
____ = clf_gbt.____(____)

# Check the values created by the predict method
print(____)

# Print the classification report of the model
target_names = ['Non-Default', 'Default']
print(classification_report(____, ____, target_names=target_names))
Kodu Düzenle ve Çalıştır