This project is a complete Machine Learning pipeline for predicting whether a loan application will be approved based on applicant details.
- ✅ Trained XGBoost model with full preprocessing
- 🚀 FastAPI backend for model predictions
- 💻 Streamlit frontend for user interaction
- 🧠 SHAP-based model explainability
- 🧰 Modular code with deployment readiness
- 📝 Well-structured and documented project
git clone https://github.com/your-username/loan-approval-project.git
cd loan-approval-projectpip install -r requirements.txtuvicorn api.main:app --reloadstreamlit run frontend/app.pyWe used SHAP to explain model predictions and identify key features affecting loan approvals.
Refer to: notebooks/explainability.ipynb for visualizations.
POST /predict
{
"Gender": "Male",
"Married": "Yes",
"Dependents": "0",
"Education": "Graduate",
"Self_Employed": "No",
"ApplicantIncome": 5000,
"CoapplicantIncome": 0,
"LoanAmount": 150,
"Loan_Amount_Term": 360.0,
"Credit_History": 1.0,
"Property_Area": "Urban"
}{
"prediction": 1,
"result": "Approved ✅"
}loan_approval_project/
├── api/ # FastAPI backend
├── frontend/ # Streamlit frontend
├── models/ # Trained model and preprocessor
├── data/ # Cleaned dataset
├── notebooks/ # EDA, training, explainability
├── requirements.txt
├── README.md
- Python
- XGBoost
- scikit-learn
- FastAPI
- Streamlit
- SHAP
This project is licensed under the MIT License.
- Kaggle Loan Prediction Dataset
- Open-source tools that made this possible 🎉