This project is an end-to-end Loan Prediction System that uses machine learning to predict whether a loan application should be approved or not based on the applicant’s details. The solution includes data preprocessing, model training, evaluation, and deployment using Flask, with additional workflow supported by Rubiscape for low-code data science and deployment.
Financial institutions face challenges in processing large volumes of loan applications. This project aims to automate the loan approval process using predictive modeling to assist banks in making efficient and consistent decisions.
Loan-Prediction-System/
│
├── dataset/
│ ├── train.csv
│ └── test.csv
│
├── templates/
│ └── index.html
│
├── static/
│ └── assets.png
│
├── app.py # Flask backend
├── utils.py # Utility functions for preprocessing
├── model.pkl # Trained ML model (Random Forest)
├── requirements.txt # Python dependencies
└── README.md
- Python 3.8+
- Pandas, NumPy – Data handling
- Matplotlib, Seaborn – Data visualization
- Scikit-learn – Machine learning algorithms
- Flask – Web application framework
- HTML/CSS – Frontend UI
- Rubiscape – No-code model building and deployment
The dataset used is from Analytics Vidhya’s Loan Prediction Challenge, containing the following features:
- Gender, Marital Status, Education, Dependents
- Self_Employed, ApplicantIncome, CoapplicantIncome
- LoanAmount, Loan_Amount_Term, Credit_History
- Property_Area
- Target: Loan_Status (Y/N)
-
Data Cleaning:
- Filled missing values (mode/median)
- Label encoding for categorical features
- Log transformation for skewed data
-
Feature Engineering:
- Combined income features
- Feature selection based on importance
-
Modeling:
- Tried multiple models: Logistic Regression, KNN, Decision Tree
- Best results from: Random Forest Classifier
-
Model Evaluation:
- Accuracy: ~81%
- Evaluated using Confusion Matrix, F1-Score, ROC-AUC
-
Deployment:
- Trained model saved as
model.pkl
- Integrated with a Flask backend
- Hosted with a simple HTML frontend to accept user input and show prediction
- Trained model saved as
Rubiscape, a visual AI platform, was used for:
- Data loading, preprocessing (null handling, encoding)
- Training and evaluating the Random Forest model
- Visualizing feature importance and confusion matrix
- Deploying the model as a REST API for scalable usage
-
Clone this repo:
git clone https://github.com/your-username/Loan-Prediction-System.git cd Loan-Prediction-System
-
Install dependencies:
pip install -r requirements.txt
-
Run the Flask app:
python app.py
-
Visit:
http://127.0.0.1:5000/
- User fills in loan application details via UI
- Model returns Loan Approved (Yes) or Loan Rejected (No)
- Deploy on AWS or Azure for cloud accessibility
- Use SHAP or LIME for model explainability
- Real-time integration with credit bureau data