Skip to content

kora11e/XAI-Bankrupcy-Prediction-and-Explanation-with-XGBoost-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bankruptcy Prediction Project for Explainable AI Classes

The project incorporates techniques of Explainable AI such as Shapley Additive Explanations, Local Interpretable Model-Agnostic Explanations and Partial Dependency Plots.

Instructions to run the code with Conda Environment

  1. Download the project as zip in upper right corner of clone the project on your machine.
  2. Open the project in your desired code editor.
  3. In the console move to folder
  4. In Conda console create the environment with command:
conda create --name <your-name>
  1. Activate environment
activate <your-name>
  1. Run following command to isntall packages from requirements.txt
conda install --file requirements.txt
  1. Run individual Jupyter Notebook blocks to display the code results.

Project Explanation

Features:

Data processing:

The project loads a big dataset that is later processed into the more appropriate set of features.

It uses a machine learning model to classify the set of values for bankruptcy.

Data Modeling:

Columnar data is parsed into ensemble model and then optimized using Bayesian Search Space to determine the best features.

Data Explanation:

Data is explained using multiple etchniques to better understand how it changes over time, instance and with/without inclusion of one feature.

Model Training:

A XGBoost Regression is trained on the scaled data coming from bankruptcy dataset.

The model learns to predict the probability of comany going bankrupt.

Explainability with LIME and GIME:

LIME (Local Interpretable Model-agnostic Explanations) is used to explain individual predictions.

Explains why a particular text was classified in a certain way by highlighting key words.

SHAP (Shapley Additive Explanations) is used to explain impact of data on particular instance.

It calculates how the prediction would change if a specific feature were included or excluded, across all possible combinations of features.

Each feature gets a SHAP value:

Positive SHAP value → pushes the prediction higher.

Negative SHAP value → pushes the prediction lower.

Docker Container Access

If you have Docker, you can access the model via fast api with post method.

'''python docker pull <your_username>/bankruptcy-prediction-api:v1 '''

'''python docker run -d -p 80:80 <your_username>/bankruptcy-prediction-api:v1 '''

Django Frontend user access

You can access the frontend interface by going to the subfolder frontend/bank and running following command:

'''python python manage.py runserver '''

After a couple of seconds the project will open. Then follow the console link or manually open local address http://127.0.0.1:8000/bankruptcy/ The user interface contains 4 pages:

  1. Home page
  2. Prediction page where you can test the model with your own data
  3. Contact page with the email address
  4. About page with information about the project

About

A project for Explainable AI techniques classes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages