Skip to content

Repository files navigation

Loan Approval Prediction

Project Overview

This project predicts whether a loan application will be approved or rejected based on applicant information and financial data. The goal is to build a binary classification model that accurately predicts loan approval while handling imbalanced data.


Dataset


Tools & Libraries

  • Python 3.x
  • Pandas – Data manipulation
  • NumPy – Numerical computations
  • Scikit-learn – Modeling and evaluation
  • Imbalanced-learn – Handling imbalanced data (SMOTE)
  • Seaborn & Matplotlib – Data visualization

Project Workflow

1. Data Collection

  • Downloaded dataset from Kaggle.
  • Loaded CSV into a Pandas DataFrame.

2. Exploratory Data Analysis (EDA)

  • Checked dataset shape, column types, and summary statistics.
  • Analyzed target variable distribution to identify imbalance.
  • Visualized categorical features vs loan status.
  • Created correlation heatmap for numeric features.
  • Confirmed there were no missing values in this dataset.

3. Data Preprocessing

  • Dropped loan_id (identifier).
  • Encoded categorical features using one-hot encoding: education, self_employed.
  • Converted target variable loan_status to binary (1 = Approved, 0 = Rejected).
  • Scaled numeric features using StandardScaler:

4. Train-Test Split

  • Split dataset into 80% training and 20% testing.
  • Stratified split to maintain class distribution:

5. Handling Imbalanced Data

Checked class distribution: Approved vs Rejected. Applied SMOTE to oversample minority class:

6. Model Training

  • Trained three models on the resampled dataset:
  • Logistic Regression
  • Decision Tree Classifier
  • Random Forest Classifier

7. Model Evaluation

  • Evaluated models on test set using:
  • Accuracy
  • Precision
  • Recall
  • F1-score (main metric due to imbalance)
  • Confusion matrix visualization

8. Model Saving

  • Saved scaler and trained models using joblib for future use:

About

This project predicts whether a loan application will be approved or rejected based on applicant information and financial data. The goal is to build a binary classification model that accurately predicts loan approval while handling imbalanced data.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages