Overview
100,000+ real Brazilian e-commerce orders. One platform. Every insight.
93% of customers never return after their first order.
That single number defines the retention challenge. This platform was built to understand why — and predict who's at risk before they leave.
CV stable 0.760±0.009
Revenue Intelligence
Monthly trends, growth rate, and order dynamics across 24 months of real data.
Customer Segments
Recency · Frequency · Monetary segmentation across 96,478 customers.
Delivery Impact
How delivery performance drives satisfaction — and why it's the single biggest churn lever.
Churn Predictor
Enter a customer's first-order details. The model predicts whether they'll ever return.
Predict to see the risk assessment.
One question
drove everything.
Why do 93% of e-commerce customers never come back after their first order? I spent weeks inside 100,000 real transactions to find out — and built this platform to prove it with data.
That number started this entire project.
- 9-table PostgreSQL schema
- Automated ingestion pipeline
- 3 analytics views · medallion arch
- FastAPI — 9 REST endpoints
- 5 production SQL queries
- RFM — 96,478 customers
- Delivery vs satisfaction analysis
- Product health scoring
- Detected + fixed target leakage
- XGBoost · AUC 0.777
- RandomizedSearchCV · 30 iters
- SHAP explainability
Most students dump CSVs into pandas and call it a project. I started by designing a 9-table relational schema in PostgreSQL — because that's what production looks like.
Two schemas: raw for data exactly as it arrived, analytics for business-ready views. This is the medallion architecture pattern used in real data lakes.
if_exists='replace' with proper indexes — not just CSV load. Batch inserts with method='multi' cut load time by 60%.
99,441 rows
Five production-grade SQL queries, each answering a real business question that an e-commerce company would actually pay to know.
The finding that changed everything came from Query 03 — delivery performance vs customer satisfaction.
The first model returned 99.9% precision. Any data scientist should immediately suspect something is wrong — and it was.
I had made a classic mistake: target leakage. recency_days was both defining the label (recency > 180 = churned) AND used as a model feature. The model wasn't learning — it was memorising a rule.
New frame: given only a customer's first-order signals, predict whether they'll ever place a second order. Recency and frequency completely excluded.
RandomizedSearchCV with 30 iterations. 5-fold stratified CV. SHAP explainability on 2,000 test samples.