Historical snapshot

Bottom lines, plotted

VIEW
NET MERCHANDISE SALES
—

Weekly net sales
This periodPrior year
Weekly net sales · first and final weeks may be partial

Revenue flow

Gross sales from identified customers

Swipe to explore the flow ↔

Sales by country

Map: Natural Earth · country centres are approximate

Top products

Ranked by net merchandise sales

PRODUCTNET SALESUNITS SOLDORDERSCREDIT / GROSSSHARE OF SALES
AS AT 30 NOV 2011

Identified customers only · full available purchase history

Recency frequency model

Recency × frequency · bubble size = historic spend

SELECT TO EXPLORE
Drag to select a group. Click a legend entry to isolate a segment.

Customer groups

Historic gross sales by customer segment

Churn

Monthly repeat activity by first-purchase cohort · last 12 cohorts

M0 is the acquisition month. Later cells show the share purchasing in that specific month. Blank cells have not matured.
DEC 2009 – NOV 2011

Pick a product

What else lands in the basket, strongest links first

Most common pairs

Baskets with both products · at least 5× chance

WEEKLY NET SALES

What we expected, and what happened

SHADED = 80% RANGE

How good is it?

METHODTYPICAL WEEKLY ERROR13-WEEK TOTAL ERROR
90-DAY REPEAT PURCHASE

ROC curve

Ranking quality across thresholds

Confusion matrix

What your decision threshold actually means

Precision–recall

Find repeat buyers without flagging everyone

What the model uses

Held-out permutation importance · ROC AUC decrease

Model vs single features

ROC AUC on the held-out snapshot · 0.5 is a coin toss

Method +
SPEND IN THE NEXT 90 DAYS, PER CUSTOMER

Predicted vs actual

Average spend per tenth of customers, ranked by prediction

Customers who bought

Predicted vs actual spend · log scale

Against a simple rule

Model vs ranking by past spend alone

What the model uses

Held-out permutation importance · R² decrease

K-MEANS · CUSTOMERS AS AT 30 NOV 2011

Customer map

Five behaviours, reduced to two dimensions

How many groups?

Separation and stability for 2 to 8 groups

Group profiles

Medians per group

GROUPCUSTOMERSSHARE OF SPENDDAYS SINCE PURCHASEORDERSHISTORIC SPENDAVERAGE ORDERDAYS AS CUSTOMER
01UCI workbookOriginal source retained
→
02DuckDB + SQLTyped ledger & reusable queries
→
03Python + PlotlyAnalysis, models & charts
→
04HTML dashboardNo running backend required

The source

A real retailer, with the edges left visible

CC BY 4.0

Online Retail II · Daqing Chen, UCI Machine Learning Repository.

1,067,371 original line items from a UK non-store retailer. Many customers are wholesalers. Original coverage: 1 December 2009 to 9 December 2011. Meridian is a fictional brand used for this demonstration.

Open the original dataset ↗

What these numbers mean

  • Net merchandise sales = positive merchandise sales minus credit transactions. This is not audited accounting revenue or profit.
  • Administrative lines and non-positive unit prices are excluded. Exact duplicate rows are removed as an explicit demo policy.
  • December 2011 is excluded because it is incomplete. Anonymous transactions remain in sales totals but not customer analyses.
  • Segmentation uses stated rules. Historical patterns and hypothetical uplifts do not prove business outcomes.

Data quality checks

Computed from the same ledger as the charts

● RECONCILED

SQL queries

Inspect the SQL behind the dashboard

READ-ONLY

↑ ↓ to move · Enter to open · Esc to close