Credit strategy and minimum expected loss

Credit Risk Modeling in Python

Michael Crabtree

Data Scientist, Ford Motor Company

Selecting acceptance rates

  • First acceptance rate was set to 85%, but other rates might be selected as well
  • Two options to test different rates:
    • Calculate the threshold, bad rate, and losses manually
    • Automatically create a table of these values and select an acceptance rate
  • The table of all the possible values is called a strategy table
Credit Risk Modeling in Python

Setting up the strategy table

  • Set up arrays or lists to store each value
# Set all the acceptance rates to test
accept_rates = [1.0, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7, 0.65, 0.6, 0.55,
                0.5, 0.45, 0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05]
# Create lists to store thresholds and bad rates 
thresholds = []
bad_rates = []
Credit Risk Modeling in Python

Calculating the table values

  • Calculate the threshold and bad rate for all acceptance rates
for rate in accept_rates:
    # Calculate threshold
    threshold = np.quantile(preds_df['prob_default'], rate).round(3)
    # Store threshold value in a list
    thresholds.append(np.quantile(preds_gbt['prob_default'], rate).round(3))
    # Apply the threshold to reassign loan_status
    test_pred_df['pred_loan_status'] = \ 
        test_pred_df['prob_default'].apply(lambda x: 1 if x > thresh else 0)
    # Create accepted loans set of predicted non-defaults
    accepted_loans = test_pred_df[test_pred_df['pred_loan_status'] == 0]
    # Calculate and store bad rate
    bad_rates.append(np.sum((accepted_loans['true_loan_status']) 
             / accepted_loans['true_loan_status'].count()).round(3))
Credit Risk Modeling in Python

Strategy table interpretation

strat_df = pd.DataFrame(zip(accept_rates, thresholds, bad_rates),
                        columns = ['Acceptance Rate','Threshold','Bad Rate'])

Example of strategy table and bad rate bar

Credit Risk Modeling in Python

Adding accepted loans

  • The number of loans accepted for each acceptance rate
    • Can use len() or .count()

Strategy table with accepted loans

Credit Risk Modeling in Python

Adding average loan amount

  • Average loan_amnt from the test set data

Strategy table with average loan amount

Credit Risk Modeling in Python

Estimating portfolio value

  • Average value of accepted loan non-defaults minus average value of accepted defaults
  • Assumes each default is a loss of the loan_amnt

Strategy table with estimated value

Credit Risk Modeling in Python

Total expected loss

  • How much we expect to lose on the defaults in our portfolio

Formula for total expected loss

# Probability of default (PD)
test_pred_df['prob_default']
# Exposure at default = loan amount (EAD)
test_pred_df['loan_amnt']
# Loss given default = 1.0 for total loss (LGD)
test_pred_df['loss_given_default']
Credit Risk Modeling in Python

Let's practice!

Credit Risk Modeling in Python

Preparing Video For Download...