Coder Social home page Coder Social logo

credit-risk-classification's Introduction

Credit Risk Classification

Overview of the Analysis

The purpose of this analysis was to predeict the healthy and high-risk loan labels. The financial information provided for this project was a CSV with all the information about loan size, interest rate, borrower income and total debt. I needed to use this information to predict whether the loans issued would be high risk or healthy loans. In total, there were 75036 healthy loans and 2500 high-risk loans. In order to complete this prediction, I used the machine learning process to split the data, train and test the model. I used the LogisticRegression module from SKLearn to train the model. After this, I saved the predicitons on the testing data labels by using the testing feature data (X_test) and the fitted model. Lastly, I evaluated the model's performance using an accuracy score, confusion matrix and classification report. I continued this analysis by refitting the training data using RandomOverSampler and rerunning the logisitic regression model.

Results

  • Machine Learning Model 1:

    • Accuracy-- 0.99
    • Precision--Healthy: 1.00 High-Risk: 0.85
    • Recall--Healthy: 0.99 High-Risk: 0.91
    • F-1--Healthy: 1.00 High-Risk: 0.88
  • Machine Learning Model 2:

    • Accuracy-- 0.99
    • Precision--Healthy: 1.00 High-Risk: 0.84
    • Recall--Healthy: 0.99 High-Risk: 0.99
    • F-1--Healthy: 1.00 High-Risk: 0.91

Summary

Both of these machine learning models predict the loan labels to a fairly high degree of accuracy, however, I would recommend the second model. I make this recommendation based off of two observations of the results. Firstly, that the accuracy of both models is the same and this therefore cannot be the only determining factor to recommending a model. Secondly, the recall is higher for the second model and since the cost of false negatives is high for loan prediction, I want to minimize the number of high-risk loans that are incorrectly classified as healthy (minimize missed high-risk loans). Utilizing the second model with higher recall means that the model can effectively identify most of the actual high-risk loans.

credit-risk-classification's People

Contributors

vmueller13 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.