The problem
Ricardo Martinelli, a newly appointed loan approval executive at General Bank (a fictional lender), has to approve or reject home-loan applications. Reviewing each file by hand is slow and can be inconsistent. Two research questions guided the study:
- Which factors are most influential in determining the approval or rejection of home-loan applications?
- How accurately can a regression model predict approval outcomes from applicant demographics and financial history?
Dataset & context
The data covers 614 past applications with 13 variables: gender, marital status, dependents, education, self-employment, applicant and co-applicant income, loan amount and term, credit history, property area, and loan status. After handling missing values, 480 complete applications remained.
Methodology
- Explored the data and handled missing values.
- Fit a logistic regression and read each factor's odds ratio (Nagelkerke R² = 0.389).
- Grew a classification tree on a 60/40 train/test split, then pruned it to a 6-split tree.
- Tuned each model's probability cutoff (0.5817 for the logistic model) and compared accuracy, sensitivity, specificity, and F1.
Tools
- R
- tidyverse
- rpart (trees)
- caret (evaluation)
- ggplot2
Key analysis
Four model versions were compared on the same test data. Tuning the cutoff improved the logistic model from 79.2% to 80.6% accuracy, and specificity from 41.7% to 45.8%.
Findings
- Credit history dominates. A strong credit history carried a log-odds coefficient of 3.7895, an odds ratio of 44.23.
- Being married and being a graduate both raised the probability of approval.
- Income and loan amount barely mattered in the logistic model but were strong predictors in the tree. The method changes the story.
- One dependent slightly lowered approval chances, while two or more raised them.
Business implication
For a lender, a predictive model can take routine screening off the loan officer's desk: fewer hours per file, and decisions that are more consistent and objective. The model's sensitivity of 97.9% means it rarely misses a good applicant. Its lower specificity (45.8%), which the paper flags as a weakness, means predicted rejections still deserve a closer look.
Final result
The logistic regression was selected as the best model: 80.6% accuracy and an F1 score of 87.04% at the tuned cutoff. The classification tree reached 78.6% and confirmed credit history as the strongest predictor.
What I learned: model choice changes which variables look important. Logistic regression makes each factor's significance easy to read, while trees capture more complex interactions. Banks should build predictive models into their risk-assessment process.
