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.
The model follows the standard banking risk framework:
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
-
Data preparation
- Clean the data, group atypicals
- Create new variables to get the target information for the estimation
-
Modeling
- Optimize hyperparameters for the three models
- Prepare the final pipelines for production
-
Production
- Scripts for retraining and execution of the predictive models
- Build the streamlit app based on the predictive models
Clone the repository and install dependencies:
conda env create -f 01_Documents/risks.yml
conda activate risks