Datasets:
Age int64 | Annual Income int64 | Home Ownership string | Employment Length (Years) float64 | Loan Purpose string | Loan Grade string | Loan Amount int64 | Interest Rate float64 | Default Status int64 | Loan % of Income float64 | Previous Default string | Credit History Length (Years) int64 | LTI Group string | Income Group string | Age Group string | Interest Rate Group string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21 | 9,600 | OWN | 5 | EDUCATION | B | 1,000 | 11.14 | 0 | 0.1 | No | 2 | Low | Very Low | 18–25 | Medium |
25 | 9,600 | MORTGAGE | 1 | MEDICAL | C | 5,500 | 12.87 | 1 | 0.57 | No | 3 | Very High | Very Low | 18–25 | High |
23 | 65,500 | RENT | 4 | MEDICAL | C | 35,000 | 15.23 | 1 | 0.53 | No | 2 | Very High | High | 18–25 | Very High |
24 | 54,400 | RENT | 8 | MEDICAL | C | 35,000 | 14.27 | 1 | 0.55 | Yes | 4 | Very High | Medium | 18–25 | Very High |
21 | 9,900 | OWN | 2 | VENTURE | A | 2,500 | 7.14 | 1 | 0.25 | No | 2 | High | Very Low | 18–25 | Very Low |
26 | 77,100 | RENT | 8 | EDUCATION | B | 35,000 | 12.42 | 1 | 0.45 | No | 3 | Very High | High | 26–30 | High |
24 | 78,956 | RENT | 5 | MEDICAL | B | 35,000 | 11.11 | 1 | 0.44 | No | 4 | Very High | High | 18–25 | Medium |
24 | 83,000 | RENT | 8 | PERSONAL | A | 35,000 | 8.9 | 1 | 0.42 | No | 2 | Very High | High | 18–25 | Low |
21 | 10,000 | OWN | 6 | VENTURE | D | 1,600 | 14.74 | 1 | 0.16 | No | 3 | Medium | Very Low | 18–25 | Very High |
22 | 85,000 | RENT | 6 | VENTURE | B | 35,000 | 10.37 | 1 | 0.41 | No | 4 | Very High | High | 18–25 | Medium |
21 | 10,000 | OWN | 2 | HOMEIMPROVEMENT | A | 4,500 | 8.63 | 1 | 0.45 | No | 2 | Very High | Very Low | 18–25 | Low |
23 | 95,000 | RENT | 2 | VENTURE | A | 35,000 | 7.9 | 1 | 0.37 | No | 2 | Very High | Very High | 18–25 | Low |
26 | 108,160 | RENT | 4 | EDUCATION | E | 35,000 | 18.39 | 1 | 0.32 | No | 4 | Very High | Very High | 26–30 | Very High |
23 | 115,000 | RENT | 2 | EDUCATION | A | 35,000 | 7.9 | 0 | 0.3 | No | 4 | Very High | Very High | 18–25 | Low |
23 | 500,000 | MORTGAGE | 7 | DEBTCONSOLIDATION | B | 30,000 | 10.65 | 0 | 0.06 | No | 3 | Very Low | Very High | 18–25 | Medium |
23 | 120,000 | RENT | 0 | EDUCATION | A | 35,000 | 7.9 | 0 | 0.29 | No | 4 | Very High | Very High | 18–25 | Low |
23 | 92,111 | RENT | 7 | MEDICAL | F | 35,000 | 20.25 | 1 | 0.32 | No | 4 | Very High | Very High | 18–25 | Very High |
23 | 113,000 | RENT | 8 | DEBTCONSOLIDATION | D | 35,000 | 18.25 | 1 | 0.31 | No | 4 | Very High | Very High | 18–25 | Very High |
24 | 10,800 | MORTGAGE | 8 | EDUCATION | B | 1,750 | 10.99 | 1 | 0.16 | No | 2 | Medium | Very Low | 18–25 | Medium |
25 | 162,500 | RENT | 2 | VENTURE | A | 35,000 | 7.49 | 0 | 0.22 | No | 4 | High | Very High | 18–25 | Very Low |
25 | 137,000 | RENT | 9 | PERSONAL | E | 34,800 | 16.77 | 0 | 0.25 | Yes | 2 | High | Very High | 18–25 | Very High |
22 | 65,000 | RENT | 4 | EDUCATION | D | 34,000 | 17.58 | 1 | 0.52 | No | 4 | Very High | High | 18–25 | Very High |
24 | 10,980 | OWN | 0 | PERSONAL | A | 1,500 | 7.29 | 0 | 0.14 | No | 3 | Medium | Very Low | 18–25 | Very Low |
22 | 80,000 | RENT | 3 | PERSONAL | D | 33,950 | 14.54 | 1 | 0.42 | Yes | 4 | Very High | High | 18–25 | Very High |
24 | 67,746 | RENT | 8 | HOMEIMPROVEMENT | C | 33,000 | 12.68 | 1 | 0.49 | No | 3 | Very High | High | 18–25 | High |
21 | 11,000 | MORTGAGE | 3 | VENTURE | E | 4,575 | 17.74 | 1 | 0.42 | Yes | 3 | Very High | Very Low | 18–25 | Very High |
23 | 11,000 | OWN | 0 | PERSONAL | A | 1,400 | 9.32 | 0 | 0.13 | No | 3 | Medium | Very Low | 18–25 | Low |
24 | 65,000 | RENT | 6 | HOMEIMPROVEMENT | B | 32,500 | 9.99 | 1 | 0.5 | No | 3 | Very High | High | 18–25 | Low |
21 | 11,520 | OWN | 5 | MEDICAL | B | 2,000 | 11.12 | 1 | 0.17 | No | 3 | Medium | Very Low | 18–25 | Medium |
25 | 120,000 | RENT | 2 | VENTURE | A | 32,000 | 6.62 | 0 | 0.27 | No | 2 | Very High | Very High | 18–25 | Very Low |
26 | 95,000 | RENT | 7 | HOMEIMPROVEMENT | C | 31,050 | 14.17 | 1 | 0.33 | Yes | 3 | Very High | Very High | 26–30 | Very High |
25 | 306,000 | RENT | 2 | DEBTCONSOLIDATION | C | 24,250 | 13.85 | 0 | 0.08 | No | 3 | Very Low | Very High | 18–25 | High |
26 | 300,000 | MORTGAGE | 10 | MEDICAL | C | 7,800 | 13.49 | 0 | 0.03 | No | 4 | Very Low | Very High | 26–30 | High |
21 | 12,000 | OWN | 5 | EDUCATION | A | 2,500 | 7.51 | 1 | 0.21 | No | 4 | High | Very Low | 18–25 | Very Low |
22 | 48,000 | RENT | 1 | EDUCATION | E | 30,000 | 18.39 | 1 | 0.63 | No | 2 | Very High | Low | 18–25 | Very High |
24 | 64,000 | RENT | 8 | DEBTCONSOLIDATION | D | 30,000 | 14.54 | 1 | 0.47 | Yes | 3 | Very High | Medium | 18–25 | Very High |
25 | 75,000 | RENT | 4 | HOMEIMPROVEMENT | D | 30,000 | 16.89 | 1 | 0.4 | Yes | 4 | Very High | High | 18–25 | Very High |
23 | 71,500 | RENT | 3 | DEBTCONSOLIDATION | D | 30,000 | 15.31 | 1 | 0.42 | No | 4 | Very High | High | 18–25 | Very High |
26 | 62,050 | RENT | 6 | MEDICAL | E | 30,000 | 17.99 | 1 | 0.41 | No | 2 | Very High | Medium | 26–30 | Very High |
24 | 12,000 | OWN | 4 | VENTURE | B | 2,500 | 12.69 | 1 | 0.21 | No | 3 | High | Very Low | 18–25 | High |
26 | 300,000 | MORTGAGE | 10 | VENTURE | A | 20,000 | 7.88 | 0 | 0.07 | No | 4 | Very Low | Very High | 26–30 | Low |
23 | 300,000 | OWN | 1 | EDUCATION | F | 24,250 | 19.41 | 0 | 0.08 | Yes | 2 | Very Low | Very High | 18–25 | Very High |
26 | 300,000 | OWN | 9 | HOMEIMPROVEMENT | B | 10,000 | 10.38 | 0 | 0.03 | No | 4 | Very Low | Very High | 26–30 | Medium |
26 | 300,000 | MORTGAGE | 0 | EDUCATION | D | 25,000 | 15.33 | 0 | 0.08 | No | 3 | Very Low | Very High | 26–30 | Very High |
25 | 300,000 | MORTGAGE | 9 | HOMEIMPROVEMENT | E | 18,000 | 16.45 | 0 | 0.06 | No | 3 | Very Low | Very High | 18–25 | Very High |
26 | 80,690 | RENT | 8 | PERSONAL | A | 30,000 | 7.49 | 1 | 0.37 | No | 3 | Very High | High | 26–30 | Very Low |
22 | 66,300 | RENT | 4 | MEDICAL | B | 30,000 | 12.69 | 1 | 0.38 | No | 3 | Very High | High | 18–25 | High |
26 | 89,028 | RENT | 0 | DEBTCONSOLIDATION | A | 30,000 | 6.62 | 1 | 0.34 | No | 3 | Very High | Very High | 26–30 | Very Low |
24 | 78,000 | RENT | 4 | DEBTCONSOLIDATION | D | 30,000 | 15.31 | 1 | 0.38 | Yes | 4 | Very High | High | 18–25 | Very High |
23 | 78,000 | RENT | 7 | DEBTCONSOLIDATION | F | 30,000 | 18.62 | 1 | 0.38 | Yes | 3 | Very High | High | 18–25 | Very High |
23 | 92,004 | RENT | 6 | PERSONAL | C | 30,000 | 15.23 | 1 | 0.33 | Yes | 3 | Very High | Very High | 18–25 | Very High |
23 | 97,000 | RENT | 7 | VENTURE | B | 30,000 | 10.65 | 1 | 0.31 | No | 2 | Very High | Very High | 18–25 | Medium |
25 | 120,000 | RENT | 9 | EDUCATION | A | 30,000 | 7.9 | 0 | 0.25 | No | 4 | High | Very High | 18–25 | Low |
26 | 280,000 | RENT | 4 | PERSONAL | C | 10,000 | 15.96 | 0 | 0.04 | Yes | 3 | Very Low | Very High | 26–30 | Very High |
26 | 277,104 | RENT | 0 | VENTURE | B | 20,000 | 11.48 | 0 | 0.07 | No | 3 | Very Low | Very High | 26–30 | Medium |
23 | 277,000 | OWN | 3 | PERSONAL | A | 35,000 | 7.49 | 0 | 0.13 | No | 4 | Medium | Very High | 18–25 | Very Low |
25 | 128,000 | RENT | 9 | PERSONAL | A | 30,000 | 7.29 | 0 | 0.23 | No | 4 | High | Very High | 18–25 | Very Low |
24 | 12,000 | OWN | 2 | VENTURE | E | 1,750 | 16.82 | 0 | 0.15 | Yes | 3 | Medium | Very Low | 18–25 | Very High |
21 | 131,000 | RENT | 0 | VENTURE | A | 30,000 | 5.99 | 0 | 0.23 | No | 4 | High | Very High | 18–25 | Very Low |
22 | 275,000 | OWN | 6 | VENTURE | B | 12,000 | 11.58 | 0 | 0.04 | No | 2 | Very Low | Very High | 18–25 | Medium |
26 | 263,000 | MORTGAGE | 0 | EDUCATION | B | 10,000 | 10.99 | 1 | 0.04 | No | 4 | Very Low | Very High | 26–30 | Medium |
25 | 221,850 | MORTGAGE | 9 | MEDICAL | D | 25,000 | 15.7 | 1 | 0.1 | No | 2 | Low | Very High | 18–25 | Very High |
22 | 70,000 | RENT | 6 | EDUCATION | D | 29,100 | 15.99 | 1 | 0.42 | No | 3 | Very High | High | 18–25 | Very High |
22 | 12,000 | MORTGAGE | 7 | EDUCATION | D | 1,500 | 14.84 | 0 | 0.13 | Yes | 3 | Medium | Very Low | 18–25 | Very High |
26 | 260,000 | OWN | 10 | HOMEIMPROVEMENT | B | 28,000 | 10.99 | 0 | 0.11 | No | 3 | Low | Very High | 26–30 | Medium |
25 | 259,000 | MORTGAGE | 9 | HOMEIMPROVEMENT | D | 20,000 | 14.42 | 0 | 0.08 | Yes | 2 | Very Low | Very High | 18–25 | Very High |
24 | 255,000 | MORTGAGE | 9 | EDUCATION | A | 9,600 | 6.99 | 0 | 0.04 | No | 2 | Very Low | Very High | 18–25 | Very Low |
25 | 250,000 | RENT | 2 | MEDICAL | C | 25,000 | 13.49 | 0 | 0.1 | No | 4 | Low | Very High | 18–25 | High |
25 | 12,000 | OWN | 0 | MEDICAL | C | 3,000 | 13.48 | 1 | 0.25 | No | 3 | High | Very Low | 18–25 | High |
22 | 56,950 | RENT | 6 | MEDICAL | A | 28,000 | 7.49 | 1 | 0.49 | No | 2 | Very High | Medium | 18–25 | Very Low |
21 | 12,000 | OWN | 6 | EDUCATION | C | 3,000 | 13.61 | 1 | 0.25 | Yes | 3 | High | Very Low | 18–25 | High |
23 | 65,000 | RENT | 2 | EDUCATION | A | 28,000 | 7.9 | 1 | 0.43 | No | 2 | Very High | High | 18–25 | Low |
26 | 85,000 | RENT | 2 | VENTURE | A | 28,000 | 7.49 | 1 | 0.33 | No | 3 | Very High | High | 26–30 | Very Low |
26 | 12,000 | OWN | 2 | EDUCATION | A | 6,100 | 7.51 | 1 | 0.51 | No | 3 | Very High | Very Low | 26–30 | Very Low |
22 | 88,000 | RENT | 6 | VENTURE | B | 28,000 | 9.91 | 1 | 0.32 | No | 3 | Very High | Very High | 18–25 | Low |
21 | 12,000 | OWN | 0 | PERSONAL | C | 4,200 | 13.48 | 1 | 0.35 | Yes | 4 | Very High | Very Low | 18–25 | High |
22 | 12,000 | OWN | 6 | DEBTCONSOLIDATION | A | 4,750 | 7.14 | 1 | 0.4 | No | 2 | Very High | Very Low | 18–25 | Very Low |
24 | 83,004 | RENT | 0 | VENTURE | D | 28,000 | 15.99 | 1 | 0.34 | Yes | 4 | Very High | High | 18–25 | Very High |
24 | 250,000 | RENT | 2 | EDUCATION | C | 18,000 | 12.98 | 0 | 0.07 | Yes | 3 | Very Low | Very High | 18–25 | High |
25 | 100,000 | RENT | 5 | DEBTCONSOLIDATION | B | 28,000 | 12.69 | 0 | 0.28 | No | 3 | Very High | Very High | 18–25 | High |
26 | 110,000 | RENT | 10 | EDUCATION | A | 28,000 | 8.9 | 0 | 0.25 | No | 2 | High | Very High | 26–30 | Low |
26 | 12,000 | OWN | 0 | DEBTCONSOLIDATION | A | 2,700 | 7.49 | 1 | 0.23 | No | 4 | High | Very Low | 26–30 | Very Low |
22 | 108,000 | RENT | 6 | EDUCATION | B | 28,000 | 10.99 | 1 | 0.26 | No | 4 | Very High | Very High | 18–25 | Medium |
23 | 151,200 | RENT | 7 | DEBTCONSOLIDATION | B | 28,000 | 11.11 | 0 | 0.19 | No | 2 | High | Very High | 18–25 | Medium |
24 | 69,000 | RENT | 2 | HOMEIMPROVEMENT | A | 27,600 | 7.49 | 1 | 0.4 | No | 2 | Very High | High | 18–25 | Very Low |
21 | 12,000 | MORTGAGE | 5 | DEBTCONSOLIDATION | E | 3,250 | 15.68 | 1 | 0.27 | Yes | 3 | Very High | Very Low | 18–25 | Very High |
22 | 70,000 | RENT | 4 | EDUCATION | C | 27,500 | 13.06 | 1 | 0.39 | Yes | 3 | Very High | High | 18–25 | High |
22 | 240,000 | OWN | 6 | PERSONAL | B | 25,000 | 10.99 | 0 | 0.1 | No | 2 | Low | Very High | 18–25 | Medium |
26 | 73,200 | RENT | 5 | VENTURE | D | 27,050 | 15.62 | 1 | 0.37 | Yes | 2 | Very High | High | 26–30 | Very High |
24 | 83,000 | RENT | 5 | PERSONAL | C | 27,000 | 13.49 | 1 | 0.33 | Yes | 2 | Very High | High | 18–25 | High |
24 | 73,399 | RENT | 0 | VENTURE | D | 27,000 | 15.31 | 1 | 0.37 | No | 3 | Very High | High | 18–25 | Very High |
23 | 62,500 | RENT | 7 | MEDICAL | B | 26,000 | 11.71 | 1 | 0.42 | No | 2 | Very High | Medium | 18–25 | Medium |
23 | 120,000 | RENT | 1 | EDUCATION | B | 25,600 | 12.69 | 0 | 0.21 | No | 3 | High | Very High | 18–25 | High |
24 | 12,360 | OWN | 2 | MEDICAL | C | 1,600 | 13.57 | 0 | 0.13 | No | 3 | Medium | Very Low | 18–25 | High |
22 | 60,000 | RENT | 0 | VENTURE | B | 25,475 | 10.99 | 1 | 0.42 | No | 3 | Very High | Medium | 18–25 | Medium |
25 | 234,000 | MORTGAGE | 3 | MEDICAL | C | 20,000 | 14.27 | 0 | 0.09 | Yes | 4 | Low | Very High | 18–25 | Very High |
24 | 234,000 | OWN | 8 | HOMEIMPROVEMENT | B | 20,000 | 8.88 | 0 | 0.09 | No | 4 | Low | Very High | 18–25 | Low |
26 | 234,000 | MORTGAGE | 10 | HOMEIMPROVEMENT | B | 21,600 | 12.18 | 0 | 0.09 | No | 3 | Low | Very High | 26–30 | High |
25 | 221,004 | MORTGAGE | 6 | DEBTCONSOLIDATION | D | 11,900 | 14.42 | 1 | 0.05 | Yes | 3 | Very Low | Very High | 18–25 | Very High |
26 | 232,500 | MORTGAGE | 0 | MEDICAL | C | 25,000 | 14.17 | 0 | 0.11 | Yes | 2 | Low | Very High | 26–30 | Very High |
Credit Risk Analysis — Exploratory Data Analysis (EDA)
1. Objective
This project identifies the key factors influencing loan default risk through exploratory data analysis. The README focuses on the most informative variables; the full analysis and code are available in the accompanying Google Colab notebook.
2. Dataset Overview
The dataset contains borrower level information used to analyze credit default risk. Each observation represents a single loan application with associated financial, demographic, and behavioral attributes.
- Raw size - Number of observations: 32,581 rows & 12 features
- Clean size - 31,415 rows & 12 original features + 4 engineered groups = 16 total
Feature Categories:
| Feature | Type | Description |
|---|---|---|
| Age | Numeric | Age of the borrower |
| Annual Income | Numeric | Borrower’s yearly income |
| Home Ownership | Categorical | Type of home ownership of the individual: Rent, Mortgage, Own & other |
| Employment Length | Numeric | Years of employment history |
| Loan Purpose | Categorical | Reason for loan |
| Loan Amount | Numeric | Total borrowed amount |
| Interest Rate | Numeric | Rate assigned based on risk. |
| Loan % Income | Numeric | ratio of loan amount to income. |
| Credit History | Numeric | The length of credit history for the individual. |
| Previous Default | Binary | indicator of past default behavior (0 = No, 1 = Yes). |
| Loan Grade | Ordinal | The grade assigned to the loan based on the creditworthiness of the borrower: A (low risk) → G (high risk) |
| Default Status | Binary | Default Status — binary variable (0 = no default, 1 = default): |
| Age Group | Categorical | Age segmented into groups (e.g., 18–25, 26–35, …) |
| Income Group | Categorical | Income divided into quantiles (Very Low → Very High) |
| LTI Group | Categorical | Loan-to-Income ratio grouped into quantiles (Very Low → Very High) |
| Interest Rate Group | Categorical | Interest rate grouped into quantiles (Very Low → Very High) |
Target Variable
- Default Status — binary variable (0 = no default, 1 = default):
- 0: Non-default - The borrower successfully repaid the loan as agreed, and there was no default.
- 1: Default - The borrower failed to repay the loan according to the agreed-upon terms and defaulted on the loan. This variable represents the outcome of the loan and is used to analyze how different borrower and loan characteristics relate to default risk.
Analytical Notes
- Mix of numerical and categorical variables with skewed distributions (notably income and loan amount)
- Outliers validated against real-world plausibility; extreme but realistic values retained
- Continuous variables segmented into quantile-based groups for interpretability
- Relative measures (e.g., LTI) prioritized over absolute valu
3. Methodology
The analysis follows a structured and decision driven exploratory data analysis (EDA) pipeline designed to uncover patterns in credit default behavior.
3.1 Data Cleaning
Column Standardization
Column names were revised to improve clarity and consistency. In addition, categorical values in the Previous Default variable were standardized by replacing abbreviations (“Y”/“N”) with full labels (“Yes”/“No”) to enhance readability and interpretability.
Invalid Values Handling
Initial exploratory checks revealed unrealistic values in key variables:
- Ages exceeding 90 years
- Employment length values above realistic working ranges (e.g.,60 years)
These values were removed from the dataset. Given their small proportion and clear inconsistency with real-world constraints, removing these rows ensured data quality without introducing bias or significantly reducing dataset size.
Missing Values Treatment
Missing interest rate values were imputed using the within loan grade median, preserving the relationship between loan grade and intrest rate. Median over mean, robust to skewed financial distributions.
Small Group Assessment
A systematic scan of all categorical variables was conducted to identify groups with insufficient sample sizes for reliable estimation.
Home Ownership — OTHER (n=106)
The OTHER category was removed from analysis (<0.3% of dataset).Sample size is insufficient for reliable default rate estimation and the category lacks a clear real-world definition.
Loan Grade — F and G
Grades F and G were identified as small groups but retained in the analysis. Although limited in size, these grades represent the highest-risk borrower segment and carry meaningful analytical value. Default rate estimates for these grades should be interpreted with caution given the small sample sizes.
3.2 Duplicates and Outliers
Duplicates
A total of 156 duplicate rows were identified and removed to ensure data integrity and avoid bias from repeated observations.
Outlier Detection and Treatment
Outliers were identified using boxplots and the IQR method. Invalid values were removed, while extreme but realistic financial observations were retained to preserve dataset variability and reflect real world borrower heterogeneity.
- Invalid outliers (e.g., unrealistic ages and employment durations) were treated as data errors and removed during preprocessing.
- Financial outliers (e.g., Annual Income, Loan Amount, Interest Rate, Credit History Length and Loan to Income ratio) were retained.
Rationale
Financial variables naturally exhibit right skewed distributions, driven by a small number of high value observations. These extreme values reflect real world heterogeneity among borrowers rather than errors. Removing them would eliminate critical information about high income individuals and high risk loan profiles.
Sensitivity analysis was conducted across three binning schemes — quantile, equal-width, and tertile — for each continuous variable analyzed. For LTI and interest rate, the monotonic relationship with default rate is consistent across all three schemes, confirming robustness. For income, equal-width binning produces near-empty upper groups due to severe right skew, making quantile binning the appropriate choice for this variable specifically. The sharp increase in default rate observed in the highest LTI and interest rate groups survives all binning schemes and is interpreted as a genuine nonlinearity rather than a boundary artifact.
4. Exploratory Data Analysis (EDA)
Research Question:
What factors are associated with a higher likelihood of loan default?
This is the bigger question that I would like to answer.
Observation:
The distribution of the target variable shows that approximately 78% of borrowers successfully repay their loans, while around 22% default. This indicates that the dataset is moderately imbalanced, with non default cases being more prevalent.
Despite the imbalance, the proportion of default cases is sufficiently large to allow meaningful analysis of factors influencing credit risk.
Research Question 1:
How effectively does loan grade capture borrower default risk?
Observation:
- Grades A and B comprise ~65% of the dataset; lower grades (E–G) are a small minority.
- Default rates increase monotonically A → G: grades A–C range from 9% → 20%, all at or below the 21.6% baseline.
- A sharp jump from C → D (20% → 59%) marks a structural break, not a gradual transition.
- Grades D–G exhibit default rates from 58% → 98%, far above baseline.
- Sample sizes decline steeply with risk (~10K at A vs. 64 at G), indicating intentional lender risk controls.

Insight:
Near-perfect separation between low-risk (A–C) and high-risk (D–G) segments. The C→D threshold suggests the grading system embeds a hard risk boundary, not just a linear scale. Grade distribution skew (many low-risk, few high-risk) reflects real-world lending behavior lenders limit exposure to high risk borrowers.
Conclusion:
Loan grade is one of the most informative predictors of default, an aggregated feature that summarizes complex financial and behavioral characteristics into a single well calibrated variable.
Statistical View:
| Signal | Detail |
|---|---|
| Monotonic risk ladder | Default rises consistently from 10% (A) → 98% (G) |
| Critical threshold C→D | Jump from 20% → 59%; transition from manageable to high risk |
| Grades D–G | Default rates exceed 60%, reaching near-certainty at G |
| Confidence intervals | Tight across all grades, including small samples |
| Sample size decay | ~10K (A) → 64 (G); consistent with intentional risk exposure limits |
Research Question 2:
Does income group influence default risk?
Observation:
- Mean income ($66.5K) exceeds median ($56K) — high-income outliers pull the average upward.
- Distribution is strongly right-skewed; log transformation yields a near-normal distribution centered at log ≈ 11 (~$60K, consistent with the median).
- The boxplot confirms the signal directly: non-defaulters (green) show a higher and tighter IQR centered at log ≈ 11, while defaulters (red) sit lower with a wider spread — indicating both lower typical income and greater income variability among those who default.
- Both groups contain high-income outliers, explaining the mean–median gap and confirming that the skew is driven by a small number of extreme values, not the general population.
- Raw income alone cannot cleanly separate risk levels — the overlap between the two boxplots is substantial. Quantile-based grouping was applied specifically to overcome this, collapsing noisy continuous values into structured, comparable risk segments.
- After quantile-based grouping (Very Low → Very High), a clear downward trend emerges: Very Low defaults at ~42–45%, Very High at ~8–10%.
- Confidence intervals are tight across all groups, indicating stable estimates.
Insight:
- Strong inverse relationship between income and default risk — higher-income borrowers are significantly less likely to default.
- The log boxplot makes the income gap tangible, but the IQR overlap between defaulters and non-defaulters confirms that raw income is insufficient as a standalone separator. Grouping converts a noisy signal into an actionable risk gradient — without it, the inverse relationship with default remains statistically visible but practically uninterpretable.
- Despite the clear trend, income alone does not account for relative loan burden — that is captured by LTI.
Conclusion: Income is a meaningful predictor of default risk, but grouping is essential to reveal it. It should be used alongside relative measures (LTI) rather than in isolation.
Research Question 3:
Does Loan to Income ratio significantly increase default risk?
Observation:
- The scatter plot of income vs. loan amount shows no clean boundary between defaulters and non-defaulters — the two groups are heavily interleaved when using absolute values alone.
- Key signal from median comparison: defaulters carry lower income (40–50K) and higher loan ($10K) vs. non-defaulters (60K+, $8K) — a higher relative burden at the median despite similar absolute loan ranges.
- Typical borrower cluster: income 30K–80K, loan 3K–15K — this is where the majority of risk mass lies, and where the overlap between groups is densest.
- This overlap is precisely why absolute values fail: two borrowers with the same $20K loan look identical until you account for whether one earns $30K and the other $120K.
- After LTI grouping, the hidden structure becomes visible — default rates increase steadily across groups, with the highest LTI group jumping sharply to ~50%+, more than double the lowest group.
Insight:
- Default risk is driven by relative financial burden, not absolute values — LTI is the feature that makes this distinction explicit.
- Income acts as a protective factor: higher income shifts borrowers into safer regions even at identical loan amounts, which is invisible in a standard income or loan amount analysis.
- The monotonic increase across LTI groups confirms that as debt burden relative to income grows, so does the probability of default — not just slightly, but in a structured, predictable gradient.
- LTI is a feature engineering outcome: neither income nor loan amount alone contains this signal. The ratio construction is what unlocks it.
Conclusion:
LTI is the strongest individual numerical predictor of default (r = 0.38). It resolves the overlap problem in raw financial variables by reframing the question from "how much did they borrow?" to "how much did they borrow relative to what they can sustain?"
Research Question 4:
Does a borrower’s past default behavior significantly predict future default risk?
Observation:
- The dataset is imbalanced: around 82% of borrowers have no prior default, while 18% have defaulted before.
- The bar chart compares default rates between borrowers with and without a history of previous default.
- Despite being the minority, borrowers with a previous default show a much higher default rate (37–38%) compared to those with no history (18%).
- This represents a substantial increase (more than double) in default probability between the two groups.
Insight:
- Previous default behavior is a strong behavioral signal of future default risk.
- The sharp difference between the two groups indicates that past financial behavior reflects underlying borrower characteristics such as repayment discipline and financial stability.
- Unlike many financial variables that require transformation or grouping, this feature provides a clear and direct separation between risk levels.
- This suggests that historical behavior captures risk factors that may not be fully observable through income or loan characteristics alone.
Conclusion:
Past default behavior is one of the strongest predictors of future default, reflecting underlying borrower reliability.
Interaction Analysis
To assess whether previous default predicts risk uniformly, default rates were examined across loan grade, LTI, and income subgroups.
Three distinct patterns emerge:
- Grade: Previous default adds minimal incremental signal within grades D–G — grade already absorbs most of the behavioral risk signal (R² = 28.76% between grade and previous default).
- LTI: Previous default compounds consistently with debt burden — a ~15–20 percentage point gap persists across all LTI groups, widening at Very High LTI.
- Income: Previous default is income-agnostic — even Very High income borrowers with prior defaults face a 23% default rate, nearly 4x higher than counterparts without prior default (6%).
Implication: Previous default operates as an independent behavioral signal relative to income and LTI, but is substantially encoded in loan grade. Its marginal contribution in a model that includes grade should be validated — independent value may be limited to segments not well-separated by grade alone.
Research Question 5:
Does home ownership status reflect differences in default risk?
Observation:
- The dataset is dominated by RENT (51%) and MORTGAGE (41%).
- Default rates differ noticeably across groups:
- RENT is around ~31%, the highest levels
- MORTGAGE sits lower at ~12%
- OWN has the lowest default rate at ~7%
- The gap between OWN and RENT is especially large, suggesting meaningful differences between these groups.

Insight:
- There’s a clear pattern here: borrowers with more stable or secured housing situations tend to default less.
- Owning a home outright is associated with the lowest risk, which likely reflects stronger financial stability and lower ongoing obligations.
- Mortgage holders fall somewhere in the middle — they carry debt, but still show lower risk than renters.
- RENT stands out as the riskiest major group, possibly because it captures borrowers with less financial cushion or less long-term stability.
Conclusion:
- Home ownership status does provide useful information about default risk, with a clear gradient from OWN (lowest risk) to RENT (highest consistent risk).
- Overall, this feature adds contextual insight, particularly in distinguishing between stable and less stable borrower segments.
Statistical View:
| Ownership | Share of Dataset | Default Rate | Risk Tier | vs. RENT |
|---|---|---|---|---|
| OWN | ~8% | ~7% | 🟢 Low | 4.4x lower |
| MORTGAGE | ~41% | ~12% | 🟡 Moderate | 2.6x lower |
| RENT | ~51% | ~31% | 🔴 High | Baseline |
Research Question 6:
Is interest rate associated with default risk, and does it reflect risk-based pricing?
Observation:
- The density curves show a clear rightward shift for defaulters, indicating that they are concentrated at higher interest rates.
- Non-defaulters are more concentrated in the lower to mid interest rate range (6–12%), while defaulters peak at higher levels (12–16%).
- The boxplot shows that borrowers who default tend to have higher interest rates on average than those who do not.
- There is noticeable overlap between the groups, but the median and overall distribution shift upward for defaulters.
- When grouping interest rates into quantile based bins, a clear pattern appears:
- Default rates increase steadily from Very Low → High
- The Very High interest rate group shows a sharp jump (~48–50%), significantly above all other groups
- Within-grade analysis confirms that interest rate bands are largely non-overlapping across grades, with within-grade standard deviation of 1% percentage point against a between-grade spread of 13% points.

Endogeneity Finding: Subgroup analysis of default rates by interest rate group within each loan grade shows near-flat patterns across all grades with sufficient data. Grade C shows an apparent anomaly but is based on n=71 observations and is excluded from interpretation. Partial correlation between interest rate and default, after removing the grade-mediated component, yields r = −0.04.
Insight:
- Interest rate is primarily a pricing output of loan grade, not an independent risk predictor — the raw correlation (r = 0.34) reflects grade's simultaneous effect on both variables.
- Lenders appear to price risk into the loan: higher-risk borrowers receive higher rates, which in turn increases financial burden and may compound default probability.
- The sharp jump in the Very High rate group likely reflects this compounding effect rather than rate as a standalone driver.
Conclusion: Interest rate is strongly associated with default risk but should not be interpreted as causal. It is both a signal of underlying risk (via grade) and a potential contributor to default through increased financial burden. Once grade is controlled for, its independent predictive value is near zero (r = −0.04).
5. Correlation Structure
Key Correlations with Default Status
| Variable | Correlation | Direction |
|---|---|---|
| Loan Grade (numeric) | 0.38 | Positive |
| Loan % of Income | 0.38 | Positive |
| Interest Rate | 0.34 | Positive |
| log_income | −0.27 | Negative |
| Annual Income | −0.16 | Negative |
Redundancy Flags (Multicollinearity)
| Variable Pair | Correlation |
|---|---|
| Interest Rate ↔ Loan Grade | 0.94 |
| Age ↔ Credit History Length | 0.88 |
| Annual Income ↔ log_income | 0.80 |
Takeaway
The strongest predictors of default are loan grade, loan-to-income ratio, and interest rate — all reflecting lender-assessed risk and borrower strain. log_income (−0.27) outperforms raw income (−0.16), justifying the log transform. Demographic variables (age, credit history, employment length) show no meaningful linear relationship with default.
6. Loan Grade as a Mediating Aggregator
Loan grade is assigned by the lender and potentially encodes multiple borrower features. Two analyses were conducted to test this: (1) correlation of each feature with loan grade (R²) to measure encoding, and (2) partial correlation with default after removing the grade-mediated component to isolate independent signal.
Finding 1 — Grade Encodes Almost Nothing Except Behavioral History
| Variable | Correlation with Grade | R² |
|---|---|---|
| Income | −0.006 | ~0% |
| LTI | 0.125 | 1.56% |
| Employment Length | −0.049 | 0.24% |
| Credit History | 0.013 | 0.02% |
| Previous Default | 0.536 | 28.76% |
The grading system in this dataset is primarily driven by behavioral history, not by income, debt burden, or employment stability.
Finding 2 — Most Variables Carry Independent Signal
| Variable | Raw r | Partial r | Independent Signal |
|---|---|---|---|
| LTI | 0.38 | 0.34 | Strong |
| Income | −0.165 | −0.163 | Full |
| Employment Length | −0.086 | −0.068 | Weak |
| Credit History | −0.018 | −0.023 | None |
| Interest Rate | 0.34 | −0.04 | None (fully redundant with grade) |
Structural Summary
- Previous Default → Grade → Default (mediated)
- LTI → Default (independent, strong)
- Income → Default (independent, full)
- Employment Length → Default (independent, weak)
- Interest Rate → Grade → Default (fully mediated, redundant)
- Credit History → Default (no signal)
Grade, LTI, income, and previous default each contribute distinct, largely non-overlapping information. Grade does not subsume the others and should not replace individual features — except for interest rate, which is fully redundant given grade.
7. Final Conclusion
This analysis demonstrates that loan default risk is not driven by isolated financial variables, but rather by the interaction between borrower capacity, loan characteristics, and behavioral history.
Among all features, Loan-to-Income ratio and Loan Grade emerge as the most informative predictors, highlighting the importance of relative financial stress and structured risk segmentation.
Overall, the findings emphasize that effective credit risk assessment requires combining multiple dimensions of borrower information rather than relying on single variable analysis.
These findings highlight the importance of feature engineering in uncovering hidden relationships that are not observable through raw variables alone.
8. Limitations
- Target variable is imbalanced (78:22). Standard accuracy is not a valid evaluation metric — precision-recall AUC and confusion matrix analysis with threshold tuning are required before any resampling is considered.
- The analysis is based on observational data and does not establish causality.
- Some variables may contain residual noise despite cleaning.
- Grouping (e.g., LTI bins) simplifies interpretation but may reduce granularity.
9. Notebook & Plots
Full analysis with code: Google Colab
10. Author
Uri Sivan
- Downloads last month
- 324















