Skip to content

imirghania/Credit_Classification_project

Repository files navigation

Credit Classification project 💰🤑💸💳

Dataset

The data is included in the data directory within this repo and it has been downloaded from @Kaggle

Objective

The objective of this project is build up a model that is capable of predicting the Credit Scores of users and being served via a web interface.

Steps

  1. EDA This project starts by exploring the data and applying a series of cleaning processes to put the data in a state that could be used to build classification models, the code of these operations could be found in this Notebook credit_cls_Data_Cleansing.ipynb.
  2. Modeling The modelling part utilizes Mlflow for experiments tracking and models registration. For reproducibility, you may run Mlflow server locally or setup it up in a remote machine, in my case, I used Dagshub integrated Mlflow server. At any case, make sure to have a .env file available at the root directory and provide the following environment variables.
# In case of running Locally

MLFLOW_TRACKING_URI="http://localhost:<port-number>"

# In case of using Dagshub, provide the tracking credentials from Dagshub repo

MLFLOW_TRACKING_URI="https://dagshub.com/<account-name>/<repo-name>.mlflow"

MLFLOW_TRACKING_USERNAME="<account-name>"

MLFLOW_TRACKING_PASSWORD="<password-str>"

the code of the modelling could be found in this Notebook credit_score_modeling.ipynb.

Note

The results of the experiments are registered at the integrated Mlflow server with this Dagshub repo.

Out of three classifiers, (RandomForest, XGBoost and LightGBM), RandomForest classifier resulted in a slightly better metrics than XGBoost but that was at the expense of the model size where the best model of the RandomForest classifier has a size of 644.46 MB whilist the best model of XGBoost has a size of 7.36 MB. Therefore, the model that has been set to production was the fine-tunned model of XGBoost.

  1. Deployment The chosen method for serving the final model of the experimentations is a web interface. The frontend is built using streamlit, the backend is built using FastAPI and both of them are connected and served using Docker The code of the frontend could be found in /frontend directory and the backend as well could be found in the /backend directory.
  • To run the web service use the following code
docker-compose up -d --build

Then go to the following url: http://localhost:8501/

  • To stop the web service use the following code
docker-compose down

About

This repository hosts a complete machine learning project focused on predicting user Credit Scores and deploying the resulting model via a robust web interface. This project demonstrates a solid MLOps pipeline, from rigorous data exploration to containerized deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors