A full-stack machine learning application that predicts loan approval probability and generates a personalized risk report based on a user's financial profile.
Built with a Random Forest classifier trained on 10,000 loan applications, served via a Flask REST API, and visualized through a React frontend with an animated SVG probability gauge.
| Layer | Technology |
|---|---|
| Model | scikit-learn Random Forest |
| Imbalance Handling | SMOTE (imbalanced-learn) |
| Backend | Python, Flask, Flask-CORS |
| Frontend | React, Vite |
| Data | Kaggle — Loan Approval Classification |
| Metric | Score |
|---|---|
| Accuracy | 92.5% |
| ROC-AUC | 0.975 |
| Approved Recall | 86% |
| Rejected Recall | 94% |
SMOTE oversampling was applied to address a 3.5:1 class imbalance between rejected and approved loans. Top predictive features were previous loan defaults, loan interest rate, and loan-to-income ratio.
LOAN-APPROVAL-MODEL/
├── Backend/
│ ├── Model/
│ │ ├── model.py # Training script
│ │ ├── loan_model.pkl # Saved Random Forest model (gitignored)
│ │ ├── model_columns.pkl # Saved feature column order (gitignored)
│ │ └── loan_data.csv # Dataset (gitignored)
│ ├── app.py # Flask REST API
│ └── test.py # API tests
└── Frontend/
├── src/
│ ├── App.jsx # Main UI component
│ └── main.jsx # React entry point
├── index.html
└── vite.config.js
