A production-ready machine learning system that predicts loan approval status using ensemble methods (Random Forest, XGBoost, LightGBM) with MLflow experiment tracking, FastAPI backend, and an interactive web interface.
Run the automated setup script that handles environment creation, dependencies, MLflow, and API:
bash run.shThis interactive script will:
- ✅ Create/activate conda environment
- ✅ Install dependencies from
requirements.txt - ✅ Start MLflow UI (http://localhost:5000)
- ✅ Optionally run model training
- ✅ Start FastAPI server (http://localhost:8000)
conda create -n deploy python=3.9.23
conda activate deploypip install -r requirements.txtOpen a terminal and run:
mlflow ui🔗 Access MLflow at: http://127.0.0.1:5000
python src/test_1.pyWith custom parameters:
python src/test_1.py -n 300 -xlr 0.05 -llr 0.07In a new terminal:
conda activate deploy
python src/api_1.py🔗 API : http://127.0.0.1:8000 🔗 API Doc: http://127.0.0.1:8000/docs
Simply open frontend/index.html in your browser.
docker build -t loan_app .docker run -p 8000:8000 -p 5000:5000 loan_appExposed Ports:
8000: FastAPI server5000: MLflow UI (optional)
- API Docs: http://127.0.0.1:8000/docs
- Frontend: Open
frontend/index.htmlin your browser
# List running containers
docker ps
# Stop container
docker stop <container_id>
# Remove container
docker rm <container_id>Loan_Approval_Prediction/
├── data/ # Dataset directory
│ └── loan_approval_dataset.csv
├── frontend/ # Web interface
│ ├── index.html # Main HTML page
│ └── main.js # Frontend JavaScript logic
├── notebook/ # Exploratory analysis
│ └── test1.ipynb # EDA & model experimentation
├── output/ # Generated artifacts
│ ├── best_loan_model.pkl # Trained model
│ └── model_results.csv # Model comparison results
├── src/ # Source code
│ ├── api_1.py # FastAPI application
│ └── test_1.py # Model training script
├── Dockerfile # Docker configuration
├── helperFunction.py # Utility functions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.sh # Automated setup script
python src/test_1.py -n <n_estimators> -xlr <xgb_learning_rate> -llr <lgbm_learning_rate>Example:
python src/test_1.py -n 300 -xlr 0.05 -llr 0.07- Accuracy (Train & Test)
- Balanced Accuracy
- F1 Score (Macro & Micro)
- ROC-AUC Score
- Accuracy Gap (overfitting indicator)
- Training Time
.. This is for DEPI Deployment task ..
THANK YOU FOR VISITING!