Session Ready
Exercise

Gradient boosted portfolio performance

At this point you've looked at predicting probability of default using both a LogisticRegression() and XGBClassifier(). You've looked at some scoring and have seen samples of the predictions, but what is the overall affect on portfolio performance? Try using expected loss as a scenario to express the importance of testing different models.

A data frame called portfolio has been created to combine the probabilities of default for both models, the loss given default (assume 20% for now), and the loan_amnt which will be assumed to be the exposure at default.

The data frame cr_loan_prep along with the X_train and y_train training sets have been loaded into the workspace.

Instructions
100 XP
  • Print the first five rows of portfolio.
  • Create the expected_loss column for the gbt and lr model named gbt_expected_loss and lr_expected_loss.
  • Print the sum of lr_expected_loss for the entire portfolio.
  • Print the sum of gbt_expected_loss for the entire portfolio.