Skip to content

Bank Customer Churn Prediction using ANN, TabNet, FT-Transformer and Autoencoder#1088

Open
kapoorraaghav wants to merge 5 commits into
abhisheks008:mainfrom
kapoorraaghav:bank_churn_v2
Open

Bank Customer Churn Prediction using ANN, TabNet, FT-Transformer and Autoencoder#1088
kapoorraaghav wants to merge 5 commits into
abhisheks008:mainfrom
kapoorraaghav:bank_churn_v2

Conversation

@kapoorraaghav

Copy link
Copy Markdown

Pull Request for DL-Simplified 💡

Issue Title : #924

  • Info about the related issue (Aim of the project) :
  • Name: Raaghav Kapoor
  • GitHub ID: kapoorraaghav
  • Email ID: raaghavkapoor@gmail.com
  • **Idenitfy yourself: GSSoC Participant

Closes: #issue number that will be closed through this PR

Describe the add-ons or changes you've made 📃

Give a clear description of what have you added or modifications made

Type of change ☑️

Added a complete end-to-end deep learning project for predicting bank customer churn. Here's what's included:

EDA: class distribution, feature distributions by churn status, correlation heatmap, churn rate by country and gender. The dataset has about a 20/80 class imbalance, which is handled using SMOTE.
ANN: 3-layer feedforward network (128, 64, 32) with BatchNorm and Dropout, used as a baseline. EarlyStopping and ReduceLROnPlateau callbacks are included.
TabNet: built from scratch in pure TensorFlow, with no external library. It uses sequential attention across 3 steps to select important features at each step.
FT-Transformer: a custom FeatureTokenizer layer embeds each scalar feature into a d-dimensional token. Then, 2 transformer blocks with MultiHeadAttention capture feature interactions.
Autoencoder + Classifier: an unsupervised pre-training stage where the encoder compresses input to 16 dimensions, followed by a supervised classifier trained on the compressed representations.
SHAP: KernelExplainer on the best-performing model for feature contribution analysis.
Keras Tuner: RandomSearch over ANN hyperparameters (hidden units, dropout rate, learning rate) with 10 trials.
Streamlit Web App: a dark-themed interactive demo that takes customer details as input. It runs all 4 models simultaneously and shows per-model churn probability, ensemble average, a risk badge, bar chart comparison, and model performance table.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested? ⚙️

Describe how it has been tested
Notebook was run end to end on the Churn Modelling dataset (10,000 rows) in a
conda environment with Python 3.9, TensorFlow 2.10, Keras 2.10.
All 4 models trained successfully with EarlyStopping — no overfitting observed.
SMOTE applied successfully — class balance confirmed after resampling.
Model weights saved and reloaded correctly — predictions verified on test set.
Streamlit app tested locally — all 4 models load and return predictions without errors.
ROC-AUC verified on held-out test set (80/20 stratified split) for all models.

Checklist: ☑️

@github-actions

Copy link
Copy Markdown

Our team will soon review your PR. Thanks @kapoorraaghav :)

@kapoorraaghav

Copy link
Copy Markdown
Author

Hi @abhisheks008 any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant