1. Learn
  2. /
  3. Courses
  4. /
  5. Credit Risk Modeling in Python

Exercise

Comparing model reports

You've used logistic regression models and gradient boosted trees. It's time to compare these two to see which model will be used to make the final predictions.

One of the easiest first steps for comparing different models' ability to predict the probability of default is to look at their metrics from the classification_report(). With this, you can see many different scoring metrics side-by-side for each model. Because the data and models are normally unbalanced with few defaults, focus on the metrics for defaults for now.

The trained models clf_logistic and clf_gbt have been loaded into the workspace along with their predictions preds_df_lr and preds_df_gbt. A cutoff of 0.4 was used for each. The test set y_test is also available.

Instructions

100 XP
  • Print the classification_report() for the logistic regression predictions.
  • Print the classification_report() for the gradient boosted tree predictions.
  • Print the macro average of the F-1 Score for the logistic regression using precision_recall_fscore_support().
  • Print the macro average of the F-1 Score for the gradient boosted tree using precision_recall_fscore_support().