Skip to content

Loan Approval Analysis involves building a machine learning model to predict whether a loan will be approved or not based on various customer features

Notifications You must be signed in to change notification settings

Abhi3886/LoanApprovalAnalysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💰 Loan Prediction System with Deployment

📌 Overview

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.


🧠 Problem Statement

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.


📂 Project Structure


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


🛠️ Technologies & Libraries Used

  • 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

📊 Dataset Details

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)

🔄 Workflow

  1. Data Cleaning:

    • Filled missing values (mode/median)
    • Label encoding for categorical features
    • Log transformation for skewed data
  2. Feature Engineering:

    • Combined income features
    • Feature selection based on importance
  3. Modeling:

    • Tried multiple models: Logistic Regression, KNN, Decision Tree
    • Best results from: Random Forest Classifier
  4. Model Evaluation:

    • Accuracy: ~81%
    • Evaluated using Confusion Matrix, F1-Score, ROC-AUC
  5. 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

🌐 Rubiscape Workflow

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

🚀 How to Run Locally

  1. Clone this repo:

    git clone https://github.com/your-username/Loan-Prediction-System.git
    cd Loan-Prediction-System
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the Flask app:

    python app.py
  4. Visit:

    http://127.0.0.1:5000/
    


✅ Prediction Output

  • User fills in loan application details via UI
  • Model returns Loan Approved (Yes) or Loan Rejected (No)

📈 Future Improvements

  • Deploy on AWS or Azure for cloud accessibility
  • Use SHAP or LIME for model explainability
  • Real-time integration with credit bureau data

About

Loan Approval Analysis involves building a machine learning model to predict whether a loan will be approved or not based on various customer features

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published