Bank Loan Prediction
The Problem
Loan rejection is often a black box - applicants get a "no" without understanding why. I wanted to build something that not only predicts approval but explains the reasoning in plain English, making the process more transparent.
What I Built
Bank Loan Prediction is an ML-powered web application that uses a Decision Tree classifier to predict loan approval outcomes. But the real value is in the explanations: when a loan is rejected, the system returns the top 3 rejection factors in human-readable language, helping applicants understand what they need to improve.
Technical Implementation
Feature Engineering
Raw financial data rarely tells the full story, so I created derived features:
- Income_Loan_Ratio - income relative to loan amount
- Loan_Burden - total debt obligations vs. income
- Income_Per_Dependent - income adjusted for family size
These ratios capture relationships that raw numbers miss.
Model Training
Training the model presented class imbalance challenges - approved loans outnumber rejections about 72/28. I used class weight balancing and 5-fold stratified cross-validation to ensure the model generalizes well. The result: 92.4% accuracy with consistent performance across both approval and rejection classes.
Tech Stack
- Frontend: Next.js 16, React 19, Tailwind CSS 4, shadcn/ui
- Backend: Flask, scikit-learn, XGBoost
- Database: Neon DB
The Challenge
The rejection explanation feature was the hardest part. I had to trace the decision tree's path for each prediction, identify which features contributed most to the rejection, and map those technical factors to plain English explanations. It required close collaboration between the ML pipeline and the API layer.
Key Takeaway
Predictive models are only useful if people understand and trust their outputs. Adding explainability transformed this from a simple classifier into a tool that actually helps users improve their financial profiles.