This project predicts Loan Approval with trained machine learning models such as (Logistic Regression , Ridge Classification, XGBOOST and Random forest Classifier )built on credit and income features. Additionally, it generates custom financial advice using a LLM, customized Report based on the outcome.
🔧 Stack:
FastAPI (backend) + SQLite3 (database) + React + Tailwind + TypeScript (frontend) + MLflow (tracking) + **LLM ** for insights.
- 📊 Trained ML model using feature engineering, PCA, and classification algorithms
- 🧠 MLflow experiment tracking
- 🔗 SQLite3 for relational data
- 🧪 FastAPI backend for inference
- 💻 React + TypeScript frontend with animated results
- 💬 LLM response according to the Result
- 🌐 Ready for cloud deployment
✅ Python Version: 3.8 - 3.10 (Recommended < 3.11)
git clone https://github.com/Ajitkumar-1001/Loan_prediction_App.git
cd Loan_prediction_App
python -m venv Loan_App
source Loan_App/bin/activate
pip install -r requirements.txtCreate a SQLite database and required tables from the CSV dataset.
python create_database.pyTrain the model with feature selection, PCA, and classifiers like Logistic Regression, Random Forest, and Ridge. Log metrics using MLflow.
python train_model.pyLogged to dagshub
uvicorn loan_api.main:app --reloadPOST /Loan/predict-loan→ returns prediction + LLM-based suggestion
cd frontend
npm installnpm run dev- Form input fields
- Animated prediction + suggestions
- Validation to avoid empty or negative values
POST /Loan/predict-loan
{
"IncomePerDependent": 10000,
"LoanAmount": 2500000,
"RiskScore": 650,
"TotalDebtToIncomeRatio": 0.4,
"InterestRate": 7.5,
"AnnualIncome": 60000,
"BaseInterestRate": 5.5
}Response:
{
"prediction": "Approved",
"message": "You are eligible for the loan.",
"llm_response": "Based on your high income and low risk, we suggest going ahead with the loan application."
}- FastAPI
- SQLite3
- MLflow
- React + TailwindCSS
- LLM (Flash-2.0)
- Docker-ready
Ajit Kumar — GitHub
This project is licensed under the MIT License.