Credit Risk Modeling in Python
Michael Crabtree
Data Scientist, Ford Motor Company
| Payment | Payment Date | Loan Status |
|---|---|---|
| $100 | Jun 15 | Non-Default |
| $100 | Jul 15 | Non-Default |
| $0 | Aug 15 | Default |
Formula for expected loss:
expected_loss = PD * EAD * LGD
Two Primary types of data used:
| Application | Behavioral |
|---|---|
| Interest Rate | Employment Length |
| Grade | Historical Default |
| Amount | Income |
| Column | Column |
|---|---|
| Income | Loan grade |
| Age | Loan amount |
| Home ownership | Interest rate |
| Employment length | Loan status |
| Loan intent | Historical default |
| Percent Income | Credit history length |
pd.crosstab(cr_loan['person_home_ownership'], cr_loan['loan_status'],
values=cr_loan['loan_int_rate'], aggfunc='mean').round(2)
plt.scatter(cr_loan['person_income'], cr_loan['loan_int_rate'],c='blue', alpha=0.5)
plt.xlabel("Personal Income")
plt.ylabel("Loan Interest Rate")
plt.show()
Credit Risk Modeling in Python