Session Ready
Exercise

Thresholds and confusion matrices

You've looked at setting thresholds for defaults, but how does this impact overall performance? To do this, you can start by looking at the effects with confusion matrices.

Recall the confusion matrix as shown here:

Set different values for the threshold on probability of default, and use a confusion matrix to see how the changing values affect the model's performance.

The data frame of predictions, preds_df, as well as the model clf_logistic have been loaded in the workspace.

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3
  • Reassign values of loan_status using a threshold of 0.5 for probability of default within preds_df.
  • Print the confusion matrix of the y_test data and the new loan status values.