Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Contributors

Languages