Skip to content

adrianriverof/Loan-Risk-Scoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loan Risk Scoring with Machine Learning

Overview

This project involves creating a model to calculate expected loss in a banking risk context. Using a loan dataset, different models are trained to estimate the capital at risk for that specific loan.

In addition, it includes a Streamlit web application that allows users to calculate loan risk using the trained models.



Risk Scoring Approach

The model follows the standard banking risk framework:

$$ EL = PD \times P \times EAD \times LGD $$

Where:

  • EL = Expected Loss (€)
  • PD = Probability of Default (%)
  • P = Principal (€)
  • LGD = Loss Given Default (%)
  • EAD = Exposure at Default (%)

In order to calculate the expected loss, the models would predict from the personal data:

  • PD with a Logistic Regression
  • LGD and EAD with LightGBM

Typical elements of banking risk modeling (WOE, KS, information value, ...) were not used in order to keep this project more applicable to a general case

Process

  1. Data preparation

    • Clean the data, group atypicals
    • Create new variables to get the target information for the estimation
  2. Modeling

    • Optimize hyperparameters for the three models
    • Prepare the final pipelines for production
  3. Production

    • Scripts for retraining and execution of the predictive models
    • Build the streamlit app based on the predictive models

Notebooks & Scripts

Installation

Clone the repository and install dependencies:

conda env create -f 01_Documents/risks.yml
conda activate risks

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors