Coder Social home page Coder Social logo

loan_research's Introduction

Loan Approval Prediction Project

Overview

This project focuses on predicting loan approval outcomes using machine learning. The dataset consists of various features such as applicant income, coapplicant income, loan amount, gender, marital status, dependents, education, self-employment status, property area, credit history, and loan amount term.

Data Preprocessing

The following data preprocessing steps have been applied to prepare the data for machine learning models:

  1. Handling Dependents Column:

    • Replaced '3+' in the 'Dependents' column with the numeric value 3.
  2. Removing Columns:

    • Dropped the 'Loan_ID' column from the dataset.
  3. Categorical Columns:

    • Identified and printed the categorical columns in the dataset.
    • Used these categorical columns for ordinal encoding.
  4. Numerical Columns:

    • Identified and printed the numerical columns in the dataset.
  5. Train-Test Split:

    • Split the data into training and testing sets using the train_test_split function.

Machine Learning Models

Three machine learning models have been implemented for loan approval prediction:

  1. Logistic Regression:

    • Utilized a logistic regression model with balanced class weights.
    • Implemented a pipeline with ordinal encoding.
  2. Naive Bayes:

    • Implemented a Gaussian Naive Bayes model.
    • Utilized ordinal encoding in a pipeline.
  3. Decision Tree Classifier:

    • Implemented a decision tree classifier with specified parameters (random_state, max_depth, min_samples_split).
    • Used ordinal encoding in a pipeline.

Model Evaluation

Evaluated the performance of each model using the following metrics:

  • F1 Score:

    • Logistic Regression: 0.8132
    • Naive Bayes: 0.8718
    • Decision Tree Classifier: 0.8377
  • Accuracy:

    • Logistic Regression: 0.7236
    • Naive Bayes: 0.7967
    • Decision Tree Classifier: 0.7480

Conclusion

The machine learning models have been trained and evaluated for loan approval prediction. Naive Bayes achieved the highest F1 score, indicating good performance in terms of precision and recall. The models can be further fine-tuned, and additional features can be explored to improve predictive accuracy.

loan_research's People

Contributors

hope205 avatar felixfrankfelix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.