Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Credit-Based-Loan-Approver-System-Using-ML

This project implements a machine learning system to predict loan approval based on applicant details. It analyzes a dataset of loan applications, performs data cleaning and exploratory data analysis (EDA), and builds classification models to determine whether a loan should be approved or not.

Dataset

The project uses the loan_approval_data.csv dataset, which contains the following information for 1000 applicants:

  • Applicant Details: Applicant_ID, Age, Gender, Marital_Status, Dependents, Education_Level
  • Financial Information: Applicant_Income, Coapplicant_Income, Savings, DTI_Ratio (Debt-to-Income Ratio), Credit_Score
  • Loan Details: Loan_Amount, Loan_Term, Loan_Purpose, Existing_Loans, Collateral_Value
  • Employment: Employment_Status, Employer_Category
  • Property: Property_Area
  • Target Variable: Loan_Approved (Yes/No)

Prerequisites

To run this project, you need Python installed along with the following libraries:

  • pandas
  • numpy
  • seaborn
  • matplotlib
  • scikit-learn

You can install these dependencies using pip:

pip install pandas numpy seaborn matplotlib scikit-learn

Usage

The main analysis and modeling code is contained in the Jupyter Notebook loan_approver_system.ipynb.

  1. Clone the repository or download the files.
  2. Ensure loan_approval_data.csv is in the same directory as the notebook.
  3. Open the notebook using Jupyter Lab or Jupyter Notebook:
    jupyter notebook loan_approver_system.ipynb
  4. Run the cells sequentially to reproduce the analysis and model training.

Methodology

The workflow followed in the notebook is as follows:

  1. Data Loading: The dataset is loaded using Pandas.
  2. Data Cleaning:
    • Missing numerical values are imputed with the mean.
    • Missing categorical values are imputed with the most frequent value (mode).
  3. Exploratory Data Analysis (EDA):
    • Analysis of target variable balance.
    • Visualizations of categorical features (e.g., Gender, Education Level).
    • Distribution plots for numerical features (e.g., Income).
    • Correlation heatmap to identify relationships between features.
  4. Preprocessing:
    • Train-test split (80% training, 20% testing).
    • Feature scaling using StandardScaler.
  5. Model Training & Evaluation: Three classification models were trained and evaluated:
    • Logistic Regression
    • K-Nearest Neighbors (KNN)
    • Gaussian Naive Bayes
  6. Feature Engineering:
    • New features DTI_Ratio_sq and Credit_Score_sq were added to potentially improve model performance.
    • Models were re-evaluated after feature engineering.

Results

Based on the evaluation metrics (Precision, Recall, Accuracy, F1-score), Logistic Regression consistently performed the best among the tested models for this dataset.

  • Logistic Regression: Achieved high accuracy and a balanced F1-score.
  • Gaussian Naive Bayes: Performed reasonably well but slightly lower than Logistic Regression.
  • KNN: Generally had lower performance metrics compared to the other two.

The project demonstrates that linear models like Logistic Regression can be quite effective for this type of tabular data, especially after proper preprocessing.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages