Credit Scoring Model and MLOps with MLflow
Python, Machine Learning, MLOps, MLflow, LightGBM, XGBoost, Scikit-learn, Credit Scoring, Optuna, Feature Engineering
Credit Scoring Model and MLOps with MLflow
Context
As part of an MLOps-oriented Data Science project, I developed a Credit Scoring model to estimate a customer's risk of loan default based on financial and behavioral data. The project covers the full model lifecycle, from data preparation to experiment tracking and version management with MLflow.
Objectives
- Build a classification model for payment default risk.
- Handle a highly imbalanced dataset.
- Optimize the decision threshold according to a business cost.
- Compare several Machine Learning algorithms.
- Implement an MLOps approach with MLflow.
- Ensure traceability of experiments and models.
Architecture
Data Sources
(Home Credit)
│
▼
Merging & Cleaning
│
▼
Feature Engineering
│
▼
Model Training
│
▼
MLflow Tracking
│
▼
Model Registry
│
▼
MLflow Model Serving
Technologies Used
- Python
- Pandas
- NumPy
- Scikit-learn
- LightGBM
- XGBoost
- MLflow
- Optuna / GridSearchCV
- Matplotlib
- Jupyter Notebook
Achievements
Data Preparation
- Merging multiple datasets.
- Cleaning and handling missing values.
- Encoding categorical variables.
- Creating new variables (Feature Engineering).
- Analyzing class imbalance.
Modeling
Comparison of several classification models:
- Logistic Regression
- Random Forest
- LightGBM
- XGBoost
- Multi-Layer Perceptron (MLP)
Performance evaluation through stratified cross-validation.
Optimization
- Hyperparameter search with GridSearchCV or Optuna.
- Decision threshold optimization.
- Definition of a business cost function giving more weight to false negatives.
- Model comparison based on business and technical metrics.
MLOps
Setting up an initial MLOps chain with MLflow:
- experiment tracking
- automatic logging of parameters
- metric tracking
- artifact storage
- model version management (Model Registry)
- testing Model Serving
Evaluation
Model comparison using several indicators:
- AUC-ROC
- Recall
- Precision
- F1-Score
- Accuracy
- Custom business cost
Skills Demonstrated
Data Science
- Data preparation
- Feature Engineering
- Exploratory analysis (EDA)
- Handling imbalanced data
Machine Learning
- Supervised classification
- Cross-validation
- Hyperparameter optimization
- Decision threshold optimization
- Business-driven model evaluation
MLOps
- MLflow Tracking
- Experiment Tracking
- Model Registry
- Model Serving
- Model version management
- Experiment reproducibility
Python Development
- Pandas
- Scikit-learn
- LightGBM
- XGBoost
- Training pipelines
Business Analysis
- Credit Scoring
- Risk analysis
- Business cost function optimization
- Supporting financial decision-making
Outcome
This project allowed me to develop a robust Credit Scoring model while implementing initial MLOps practices. Using MLflow ensured full traceability of experiments, model version management, and readiness for future industrialization.
Skills Acquired
- Python
- Pandas
- NumPy
- Scikit-learn
- Machine Learning
- Classification
- Credit Scoring
- LightGBM
- XGBoost
- MLflow
- MLOps
- Experiment Tracking
- Model Registry
- Model Serving
- Feature Engineering
- Cross Validation
- GridSearchCV
- Optuna
- Data Visualization
- Jupyter Notebook