What the app does
A Streamlit dashboard in dashboard.py for e-commerce churn.
Explore
Churn rates by tenure, satisfaction, device, payment method and other fields.
Model
Random forest and logistic regression, with accuracy, a confusion matrix and feature importance.
Score one customer
Enter a customer profile and get a churn probability.
Open the Streamlit app (it may take a minute to wake up).
Which data it runs on
Models on the demo data
| Model | Accuracy | AUC |
|---|---|---|
| Always guess "stays" | 56.7% | 0.500 |
| Logistic regression | 56.8% | 0.573 |
| Random forest | 58.8% | 0.631 |
5-fold cross-validation on the 1,000 generated customers.
The built-in pattern
The generator raises churn for customers with satisfaction 2 or lower, a complaint, or tenure of 6 months or less. 70% of demo customers match.
Churn is 54% for them and 19% for the rest. Any "key churn drivers" the app finds on demo data are these planted rules.
Before using it on real customers
Data
- Load real customer records, and say where they came from and under what licence.
- Define churn from later behaviour, such as no order in the next 90 days.
- Test on a later time period, the way the model would be used.
Use
- Check accuracy and false alarms by customer group, such as city tier and gender.
- Use scores to choose who gets a retention offer, not to treat anyone worse.
- Measure the offer with a holdout group, so the impact is known, not assumed.
Reliable AI checklist
The six questions of the Reliable AI Adoption Framework, answered for this project.
Business problem
Spot customers likely to stop buying, so a retention team can reach them first.
Data readiness
The real dataset is not included. The hosted app runs on generated demo data with planted patterns.
Governance and risk
Scores from demo data must never be presented as customer insight. The app now says which data it is using.
Technology and tools
Random forest and logistic regression in Streamlit. Simple and inspectable.
People and adoption
A retention lead reviews the list and chooses the offer. The model only ranks.
Outcomes and monitoring
On real data, compare predicted and actual churn each quarter, by customer group.