This project focuses on predicting credit card approval using a machine learning model (Multilayer Perceptron, MLP) and interpreting the model's predictions using explainability techniques such as LIME (Local Interpretable Model-agnostic Explanations) and SHAP (SHapley Additive exPlanations).
The dataset used contains customer features such as income, family size, and mortgage details, with the goal of predicting whether a customer will be approved for a credit card. This project also compares the interpretability of LIME and SHAP in explaining model outcomes.
The dataset contains the following features:
- ID: Customer ID
- Age: Customer Age
- Experience: Work experience (in years)
- Income: Annual income (in thousands)
- Zipcode: Residential area zipcode
- Family: Number of family members
- CCAvg: Average monthly credit card spending
- Education: Education level (1: Bachelor, 2: Master, 3: Advanced Degree)
- Mortgage: Mortgage (in thousands)
- Securities Account: Boolean indicating if the customer has a securities account
- CD Account: Boolean indicating if the customer has a Certificate of Deposit account
- Online: Boolean indicating if the customer uses online banking
- CreditCard: Target column, indicates whether a credit card is approved (1: Yes, 0: No)
- Load the dataset and perform basic exploratory data analysis (EDA).
- Visualize and normalize features where appropriate.
- Build an MLP model with no more than 2 hidden layers.
- Perform 5-fold cross-validation to evaluate model performance.
- Report training error and cross-validation error.
- Select 5 random data points and apply LIME to explain the individual predictions.
- Implement submodular pick and generate LIME explanations for 10% of the training data with up to 5 explanations.
- Use these explanations to predict credit card approval on the entire dataset and calculate the classification error.
- For the same 5 data points selected in Task 3, apply SHAP to explain the predictions.
- Compare the insights obtained from LIME and SHAP.
- Share key observations on the explainability of the MLP predictions.
To run this project, you need the following dependencies:
- Python 3.x
- pandas
- numpy
- scikit-learn
- tensorflow
- lime
- shap
- matplotlib
- seaborn
Install the dependencies via pip:
pip install -r requirements.txt
- Clone the repository:
git clone https://github.com/your-username/Credit_Card_Approval_Explainability.git
- Navigate to the project directory:
cd Credit_Card_Approval_Explainability
- Run each py files
python file_name.py
The results and visualizations of LIME and SHAP will be displayed within the notebook. Additionally, observations on the differences between LIME and SHAP will be discussed in the notebook.