Online Retail dataset

541,909 invoice lines from a UK online retailer, 1 December 2010 through 9 December 2011. The segmentation blueprint uses a customer table rolled up from these lines.

541,909 invoice lines and 8 columns. Creator: UCI Machine Learning Repository. License: CC BY 4.0. Based on the UCI Machine Learning Repository record. Chen, D. (2015). Online Retail. DOI 10.24432/C5BW33.

Source: UCI Machine Learning Repository, Online Retail (Chen, 2015). License: CC BY 4.0.

Columns

Columns listed for this table
ColumnWhat it holds
InvoiceNoInvoice number. A leading C marks a cancellation.
StockCodeProduct code.
DescriptionProduct name. Blank on some lines.
QuantityUnits on the line. Negative when the line is a cancellation.
InvoiceDateDate and time of the invoice.
UnitPricePrice per unit, in sterling.
CustomerIDCustomer id. Blank on 135,080 lines where the buyer was not identified.
CountryDelivery country. Most lines with a customer id are for the United Kingdom. The segmentation run does not use this column.

Describe it on the canvas

K-Means plot of 4,338 Online Retail customers in two clusters.
Cluster plot
K-Means metrics for Online Retail customers. Silhouette 0.4340. Calinski-Harabasz 4364.4870. Davies-Bouldin 0.8918.
Metrics

Published run

The download is the invoice file. The canvas loads a customer table built from it: lines with a customer id, a positive quantity, and a positive price, after cancellations are dropped. That leaves 397,884 lines and 4,338 customers. Recency is days from each customer's last invoice to 2011-12-10, the day after the last invoice in the file (2011-12-09). Frequency is the number of distinct invoices. Monetary value is the sum of quantity times price. The customer id is the grouping key and is not a feature. Country stays out. Power transform uses log. Normalization uses the standard scale. K-Means uses k=2, the silhouette peak for k from 2 through 8, seed 42. Silhouette 0.4340. Calinski-Harabasz 4364.4870. Davies-Bouldin 0.8918. The groups hold 2,682 and 1,656 customers. scikit-learn 1.4.2, computed on 2026-11-04. The Online Retail blueprint opens this graph and plays the same run. The voice says silhouette 0.4340, Calinski-Harabasz 4364.4870, and Davies-Bouldin 0.8918. Silhouette is positive and well short of 1. Davies-Bouldin is below 1. k of 2 is the peak of that check, and it is a candidate, not proof of two segments.