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.
Example output โ a peek before you generate
| datetime | store_id | product | department | quantity | unit_price | line_total |
|---|---|---|---|---|---|---|
| 2026-06-30 12:14 | S1 | Tortilla Chips | Snacks | 2 | $3.49 | $6.98 |
| 2026-06-30 12:14 | S1 | Salsa | Snacks | 1 | $3.99 | $3.99 |
| 2026-06-30 12:14 | S1 | Soda 12pk | Snacks | 1 | $6.99 | $6.99 |
| 2026-06-30 17:02 | S2 | Spaghetti | Pasta Night | 2 | $1.99 | $3.98 |
Notice the chips + salsa + soda basket โ that's a real product affinity, not chance. A real file has up to 200,000 rows; set your row count below and click Generate for your own.
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.
| Column | Type | Description |
|---|---|---|
| transaction_id | integer | The basket; multiple item rows share it. |
| datetime | datetime | Timestamp with realistic hour-of-day weighting. |
| store_id | text | Which store rang the sale (scales with row count). |
| product / department | text | The item and its aisle/department. |
| quantity / unit_price | number | Units and shelf price. |
| line_total | number | quantity ร unit_price. |
| payment | text | Card / Cash / Mobile. |
| anomaly | 0/1 | Present 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
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.