Git Product home page Git Product logo

credit_risk_analysis's Introduction

Credit_Risk_Analysis

Project Overview

The purpose of this project is to analyze the credit card credit dataset from LendingClub, a peer-to-peer lending services company, Then using oversample the data using the RandomOverSampler and SMOTE algorithms, and undersample the data using the ClusterCentroids algorithm. Then, use a combinatorial approach of over-and undersampling using the SMOTEENN algorithm. Next, compare two new machine learning models that reduce bias, BalancedRandomForestClassifier, and EasyEnsembleClassifier, to predict credit risk.

Deliverable 1: Use Resampling Models to Predict Credit Risk.

Using my knowledge of the imbalanced-learn and scikit-learn libraries, I evaluate three machine learning models by using resampling to determine which is better at predicting credit risk. Use the oversampling RandomOverSampler and SMOTE algorithms, and then use the undersampling ClusterCentroids algorithm. Using these algorithms, I resample the dataset, view the count of the target classes, train a logistic regression classifier, calculate the balanced accuracy score, generate a confusion matrix, and generate a classification report.

Deliverable 2: Use the SMOTEENN algorithm to Predict Credit Risk

Using my knowledge of the imbalanced-learn and scikit-learn libraries, I used a combinatorial approach of over-and undersampling with the SMOTEENN algorithm to determine if the results from the combinatorial approach are better at predicting credit risk than the resampling algorithms from Deliverable 1. Using the SMOTEENN algorithm, I resample the dataset, view the count of the target classes, train a logistic regression classifier, calculate the balanced accuracy score, generate a confusion matrix, and generate a classification report.

RandomOversampling

ram1

ram2

ram3

SMOTE Oversampling

smotth1

smotth2

smotth3

Undersampling

undersamp1

undersamp2

undersamp3

Combination Sampling

Cmbinesmapling1

Cmbinesmapling2

Cmbinesmapling3

Balanced Random Forest Classifier

balance1

balance2

balance3

Easy Ensemble AdaBoost Classifier

nwe1

nwe2

nwe3

Summary

  • To determine which model is best at predicting high-risk loans, we undersampled, oversampled, and combined both. Using ensemble classifiers, we resampled the data using the next two models in order to predict which loans are high or low risk. Oversampling, undersampling, and mixed models have low recall and our accuracy score is not as high as ensemble classifiers.

Recomedation

  • I would suggest using the ensemble classifiers over the models. Easy Ensemble had the best balance of all the models because of its high accuracy score and a good balance of precision and recall scores.

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.