Retail POS Basket Data Generator

Basket-level point-of-sale transactions with real product affinities — items that genuinely co-occur (chips + salsa + soda), plus store IDs, hour-of-day patterns, and a payment mix. The dataset market-basket and association-rule tutorials actually need.

SeededCSV + ExcelFraud labels100% in-browser

Generate the dataset

Save / load scenario (stored only in this browser)

Quick-start presets

What's in this dataset

Each row is one item within a basket. Group by transaction_id to reconstruct each shopper's basket for association-rule mining.

ColumnTypeDescription
transaction_idintegerThe basket; multiple item rows share it.
datetimedatetimeTimestamp with realistic hour-of-day weighting.
store_idtextWhich store rang the sale (scales with row count).
product / departmenttextThe item and its aisle/department.
quantity / unit_pricenumberUnits and shelf price.
line_totalnumberquantity × unit_price.
paymenttextCard / Cash / Mobile.
anomaly0/1Present only with injection on; flags suspicious transactions (e.g. odd-hour high-value bulk).

Why it's realistic

The catalog is organized into affinity groups — sets of items that really go together, like {tortilla chips, salsa, guacamole, soda} or {diapers, wipes, baby food}. Each basket draws one or two of these groups and co-purchases their members at high probability, with the occasional impulse buy mixed in. That means an association-rule miner (Apriori/FP-Growth) will actually surface lift between linked products — the whole point of a market-basket exercise — instead of finding nothing because the items were independent. Layer on weighted shopping hours, weekend/holiday traffic lifts, and multiple stores, and you get transaction data that behaves like a real grocery POS feed.

Good for

Market-basket analysis Association rules (Apriori / FP-Growth) Recommendation demos Store / hourly sales dashboards Fraud / anomaly detection SQL window-function practice

FAQ

How do I run market-basket analysis on this?

Group rows by transaction_id to form item lists, then feed them to Apriori or FP-Growth. You should see strong lift within the affinity groups baked into the catalog.

How many stores are there?

It scales with size — from one store on small files up to eight on large ones — so you can compare store performance.

Is anything uploaded?

No — generation is 100% in your browser.