Coder Social home page Coder Social logo

malvi1497 / credit_risk_analysis Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 22 KB

To evaluate the performance of supervised machine learning models to make a written recommendation on whether they should be used to predict credit risk.

Jupyter Notebook 100.00%
python clustercentroids imbalanced-learning jupyter-notebook machine-learning-algorithms random-forest-classifier randomoversampler scikit-learn smote supervised-learning

credit_risk_analysis's Introduction

Credit_Risk_Analysis

Aim

To evaluate the performance of supervised machine learning models to make a written recommendation on whether they should be used to predict credit risk.

Overview

Using the credit card credit dataset from LendingClub, a peer-to-peer lending services company, we will oversample the data using the RandomOverSampler and SMOTE algorithms, and under sample the data using the ClusterCentroids algorithm. Used a combinatorial approach of over- and undersampling using the SMOTEENN algorithm to compare two new machine learning models that reduce bias, BalancedRandomForestClassifier and EasyEnsembleClassifier, to predict credit risk.

Results

  • Naive Random Oversampling results: Our balanced accuracy test it 66%, the precision for the high_risk has a very low positivity at 1% and the recall is 66% naive.

image

  • SMOTE oversampling results: the accuracy score is 64%, the precision for the high_risk loans has a low positvity again at 1% and recall is 64% overall smote

image

  • Undersampling results: balanced accuracy score is 45% overall, the precision is at 99% and the recall is 45%.

image

  • Combination(over and undersampling) results: balanced accuracy score is 64% the precision is 99% and the recall is 57% overall combination.

image

  • Balanced Random Forest Classifier results: the accuracy score is 87.3% the precision is 99% and the recall is 87% random forest.

image

  • Easy Ensemble AdaBoost Classifier results: the accuracy score is 90.0% the precision is 99% and the recall is 90% ensemble.

image

Summary:

In the first four models we undersampled, oversampled and did a combination of both to try and determine which model is best at predicting which loans are the highest risk. The next two models we resampled the data using ensemble classifiers to try and predict which which loans are high or low risk. In our first four models our accuracy score is not as high as the ensemble classifiers and the recall in the oversampling/undersampling/mixed models is low as well. Typically in your models you want a good balance of recall and precision which is why I recommend the ensemble classifiers over the first four models. It appears that the Easy Ensemble had the best balance of all the models because of it's high accuracy score and good balance of precision and recall scores.

credit_risk_analysis's People

Contributors

malvi1497 avatar

Stargazers

 avatar

Watchers

 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.