Every lost user means lost revenue. In the crowded fintech space, spotting customers who are about to bail—and winning them back—can make or break growth. Build a working churn-prediction tool and dashboard demo.
-
Generate churn-probability scores for each user.
-
Deliver an interactive dashboard that visualizes those scores.
This project is a churn prediction tool and interactive dashboard for fintech customer data. It predicts the probability of customer churn using both Random Forest and XGBoost models, and visualizes results with Streamlit. The dashboard supports light/dark mode, feature importance, AUC comparison, and lets you upload your own CSV for batch predictions.
- Upload & Parse: Upload a CSV of customer data. Handles missing and noisy data.
- Churn Prediction: Predicts 30-day churn using Random Forest and XGBoost (AUC-optimized).
- Visualization:
- Churn probability distribution (histograms)
- Churn vs. retain pie charts
- Feature importance (pie charts)
- AUC comparison (pie charts)
- Top-10 at-risk customers table
- Download: Download predictions as CSV.
- Theme: Toggle between light and dark mode.
- Explainability: Feature importance for both models.
git clone https://github.com/CodeRulerNo1/No-Churn-Shall-Pass.git
cd No-Churn-Shall-Passpip install -r requirements.txtMain dependencies:
- streamlit
- pandas
- numpy
- matplotlib
- seaborn
- scikit-learn
- xgboost
- joblib
Train the models using train.ipynb or use the provided model files:
best_churn_model.pkl(Random Forest)best_xgb_churn_model.pkl(XGBoost)
Place these files in the project root.
streamlit run app.py- Open the dashboard in your browser (Streamlit will provide a local URL).
- Upload a CSV with customer data (must include a
customerIDcolumn). - View predictions, plots, and feature importances.
- Download the predictions as a CSV.
- Toggle light/dark mode from the sidebar.
Your input CSV should include at least these columns:
customerIDtenureMonthlyChargesTotalChargesContractInternetServicePaymentMethodOnlineSecurity- (other columns are handled but not required for prediction)
See train.ipynb for:
- Data cleaning, upsampling, and feature engineering
- Model training (Random Forest & XGBoost)
- Hyperparameter tuning (GridSearchCV)
- Model evaluation (AUC, ROC, classification report)
- Saving models with
joblib
- Random Forest and XGBoost models are trained on engineered features.
- Both models are optimized for AUC-ROC.
- Feature importance is extracted and visualized for both models.
- Predictions are made on uploaded data and visualized in the dashboard.
- Churn Probability Distribution: Histogram for each model.
- Churn vs. Retain: Pie chart for each model.
- Feature Importance: Pie chart for each model.
- AUC Comparison: Pie chart for each model.
- Top-10 At-Risk Customers: Table in sidebar.
| Model | AUC | Test Accuracy |
|---|---|---|
| Random Forest | 0.96 | 0.89 |
| XGBoost | 0.92 | 0.87 |
- Theme: Use the sidebar toggle to switch between light and dark mode.
- Feature Importance: Update feature importance values in
app.pyif retraining models.
- @Ichhabal Singh (Team Lead)
- Worked on Model training, integration of model with dashboard and improved dashboard visualizations and functions.
- @Anuj Sangwan
- Worked on the design and implementation of dashboard.