This project uses historical personal loan data from 10,000 borrowers to develop and evaluate regression models for predicting loan interest rates. The analysis includes data preparation, feature engineering, train-test validation, correlation analysis, model comparison, and evaluation on unseen data.
The project was originally developed as part of graduate-level data science coursework and was subsequently polished for inclusion in my data analytics portfolio.
The objective of the analysis is to identify a regression model that effectively predicts personal loan interest rates using borrower and loan characteristics.
Four candidate linear regression models were developed and compared using Akaike Information Criterion (AIC), Bayesian Information Criterion (BIC), and adjusted R-squared.
The original dataset contains 10,000 borrower records. Relevant variables were selected and renamed for analysis.
Data preparation included:
Examining the dataset for missing values
Investigating missing debt-to-income ratios
Replacing missing individual debt-to-income ratios with corresponding joint debt-to-income values where appropriate
Converting loan issue dates to month
Creating binary indicators for loan term and selected loan purposes
Converting categorical predictors to factors
Removing redundant source variables following transformation
The cleaned dataset was then divided into an 80% training set and 20% test set using a fixed random seed for reproducibility.
Correlation matrices were generated for the training and test datasets to assess relationships among numeric variables and determine whether those relationships were reasonably consistent between the two samples.
Four candidate regression models were evaluated using different combinations of borrower and loan characteristics.
The models incorporated predictors including:
Annual income
Loan term
Credit utilization
Loan grade
Issue month
Debt-to-income ratio
Recent credit inquiries
Loan purpose
Interaction effects between income, credit utilization, and loan term were also evaluated in one candidate model.
The four models were compared using:
AIC — lower values indicate a better relative fit
BIC — lower values indicate a better relative fit while imposing a stronger penalty for model complexity
Adjusted R-squared — higher values indicate greater explanatory power while accounting for the number of predictors
The model using loan grade as the sole predictor performed best across all three criteria.
Metric
Model 3 Result
AIC
24,170.03
BIC
24,225.92
Adjusted R²
0.952
Despite its simplicity, Model 3 outperformed the more complex candidate models.
Model 3 was evaluated on the previously unseen test dataset.
The model achieved an adjusted R-squared of 0.947 on the test data, compared with 0.952 on the training data. The similar performance across the two datasets indicates that the model generalized well to unseen observations.
Among the candidate models evaluated, loan grade alone provided the strongest predictor of interest rate. More complex specifications incorporating borrower income, debt-to-income ratio, credit utilization, loan purpose, loan term, and interaction effects did not improve overall model performance.
The results also demonstrate the value of evaluating model complexity rather than assuming that adding predictors necessarily produces a better model.
The analysis was completed in R using:
tidyverse
car
lm.beta
olsrr
nnet