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.
Cet exercice fait partie du cours
Credit Risk Modeling in Python
Instructions
- Predict the
loan_status
values for theX
test data and store them ingbt_preds
. - Check the contents of
gbt_preds
to see predictedloan_status
values not probabilities of default. - Print a
classification_report()
of the model's performance againsty_test
.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# 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))