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

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.

Bu egzersiz

Credit Risk Modeling in Python

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Set the threshold for defaults to 0.5
____[____] = ____[____].apply(lambda x: 1 if x > ____ else 0)

# Print the confusion matrix
print(____(____,____[____]))
Kodu Düzenle ve Çalıştır