MARKET BASKET

Association Rules (Apriori)

Discover which products are bought together, identify cross-selling opportunities, and create data-driven bundle recommendations

What We Do

From raw rows to high‑value rules and bundles.

Build Transactions

Convert long or wide data into transactions and compute basket stats and item frequencies.

Mine Rules

Run Apriori with your thresholds; compute support, confidence, lift, leverage, and conviction.

Filter & Rank

Filter by min_lift; prepare top rules by lift, confidence, and support for review.

Actionable Bundles

Suggest bundle candidates from strong rules with expected uplift estimates.

What You’ll Receive

Direct mapping to the analysis module’s result object.

Market Basket Metrics

Total transactions analyzed, unique items found, average basket size, number of association rules discovered, strong rules (lift > 2), confidence and lift averages, most frequent item statistics

Association Rules & Bundles

Top rules sorted by lift/confidence/support with "if X then Y" patterns, frequent itemsets showing popular combinations, bundle recommendations with expected uplift percentages, category cross-sell patterns

Visualization Data

Network graph showing item relationships, confidence vs lift scatter plots, category affinity matrix, lift distribution histograms for rule quality assessment

What Makes This Powerful

Frequent Itemsets

Apriori/FP‑Growth to mine itemsets efficiently with support, confidence, and lift metrics.

Filters & Constraints

Min support/confidence/lift, item/category include/exclude, closed/maximal itemsets.

Actionable Output

Bundles for cross‑sell, aisle adjacency, and network visualizations for stakeholder buy‑in.

What You Need to Provide

Transaction Data Structure

Your data needs a transaction_column (order/basket ID) and item_column (product/SKU). Each row represents one item in a transaction.

Data formats supported: Long format (transaction-item pairs) or wide format (binary matrix with items as columns). The algorithm automatically handles both formats.

Minimum requirements: At least 1,000 transactions recommended, ideally 10,000+ for reliable patterns. More transactions improve rule quality.

Key parameters: Support (how frequent), confidence (how reliable), lift (how much better than random). Default thresholds are optimized for retail but adjustable.

Schema Preview / transaction_id, item, customer_id (optional)

Quick Specs

Columnstransaction_id, item/product_id
Scale≥ 10k transactions recommended
Dimensionscustomer, time, category (optional)
Thresholdssupport, confidence, lift, max_length
Outputsrules, metrics, bundles, graphs

How We Find and Use Rules

From raw transactions to deployable bundles

1

Prepare & Encode

Construct baskets, clean items, and one‑hot encode transactions; choose dimensions for slicing.

2

Mine & Filter

Run Apriori/FP‑Growth with thresholds; filter rules by lift/conviction and apply business constraints.

3

Interpret & Deploy

Create cross‑sell bundles and planograms, export lists, and validate with A/B tests or backtests.

Why This Analysis Matters

Association rules reveal purchase affinities that power cross‑sell, promotions, and store layout—boosting basket size and conversion.

Focus on high‑lift, actionable rules and validate downstream impact. Network graphs and segment cuts make findings easy to communicate and deploy.

Note: Spurious rules can arise by chance; prefer lift/conviction and holdout validation, and test important bundles experimentally.

Ready to Discover Bundles?

Mine association rules and deploy cross‑sell strategies

Read the article: Association Rules