Skip to content

This project aims to predict loan defaults in retail banking using an end-to-end MLOps pipeline. It includes data preprocessing, model engineering, CI/CD, model tracking and cloud deployment of the best model via a Flask app

License

Notifications You must be signed in to change notification settings

Medkallel/Loan-Default-Prediction

Repository files navigation

Loan Default Prediction

banner

Table of Contents


Technologies Used

Python Pandas NumPy Scikit-Learn Matplotlib Jupyter Notebook Flask MLflow Docker


Description

This project is focused on building an app that estimates the probability of default for each client based on their characteristics. Then create a CI/CD pipeline to deploy it with AWS Elastic Container Service

Objectives

The main objective of this project is build an image and a pipeline with all the necessary tools to achieve the deployment of a predictive app. The specific steps include:

  1. Data Preprocessing: Filtering and preparing the dataset for analysis.
  2. Model Engineering: Test at least two classification algorithms.
  3. Model Tracking: Tracking the metrics and artifacts of the model with MLflow.
  4. App Deployment: Create a CI/CD pipeline.

Presentation

A presentation is available as a PDF file in the repo Loan_Default_Prediction_MLOPS_Presentation.pdf & also as a Canva/Powerpoint presentation through the following link: Presentation Link.


Notebooks Overview

  1. ¨Exploratory_Data_Analysis.ipynb:
    • This notebook contains the data exploration, analysis & preprocessing.
  2. ¨Loan_Default_Prediciont_Models.ipynb:
    • This notebook contains the models fitting, evaluation and mlflow setup.

Using Docker

1. Pulling the Docker Image

To pull the Docker image from Docker Hub, run the following command:

# Pull the docker image
$ docker pull medkallel/loan-default-prediction:latest

2. Building the Docker Image

If you prefer to build the Docker image locally, navigate to the project directory and run:

# Build the docker image
$ docker build -t loan-default-prediction .

3. Running the Docker Container

To run the Docker container, use the following command:

# Run the docker container
$ docker run -p 5000:5000 loan-default-prediction

Tip

You can access the app on another device by following the link: http://<server-ip>:8501


Installation

Important

The project was done on Python 3.11.6

To run this project locally, follow these steps:

  1. Clone the repository:
# Clone the repository
$ git clone https://github.com/Medkallel/Loan-Default-Prediction.git
# Navigate into the directory
$ cd Loan-Default-Prediction
  1. Install the required dependencies:
# Install the requirements
$ pip install -r requirements.txt

Usage

  1. To use the App, Just run the app.py
$ python app.py

Project structure

📦 mlops-project/
├── 📁.github/
│   └── 📁workflows/
│       └── aws.yaml
├── 📁Data/
│   ├── 🗃️Loan_Data_Describe.csv # Describe data used to denormalize
│   ├── 🗃️Loan_Data.csv # Initial Dataset
│   └── 🗃️Processed_Loan_Data.csv 
│ 
├── 📁Models/
│   └── 🤖model.pkl
│
├── 📁mlartifacts/ # Contains mlflow artifacts for runs
├── 📁mlruns/ # Contains mlflow runs logs
│ 
├── 📁templates/
│   └── index.html
├── 🐍app.py
├── 📓Exploratory_Data_Analysis.ipynb
├── 📓Loan_Default_Prediction_Models.ipynb
├── 📄requirements.txt
├── 📄.dockerignore
├── 📄.gitignore
├── 📄Dockerfile
├── 📄LICENCE.md
├── 📄README.md
└── 📄Loan_Default_Prediction_MLOPS_Presentation.pdf

Collaborators

This project was developed by a collaborative team. Each member played a crucial role in the research, development, and analysis:

  • Mohamed Kallel
  • Jean Christophe Rigoni
  • Simon Pierre Rodner

License

This project is under the CC BY-NC 4.0 License. For more information, refer to the license file.
License: CC BY-NC 4.0

About

This project aims to predict loan defaults in retail banking using an end-to-end MLOps pipeline. It includes data preprocessing, model engineering, CI/CD, model tracking and cloud deployment of the best model via a Flask app

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages