liveBook · Manning

Market basket analysis

As explained in Data Without Labels

Market basket analysis is a data-mining technique for identifying relationships among items purchased in the same transaction.

Market basket analysis identifies relationships among items purchased in the same transaction. Association rules express these relationships as antecedents leading to consequents, such as milk and eggs → bread, and support merchandising, recommendations, marketing, and diagnosis. section 4.11 section 4.2

A practical analysis follows this path:

  • Define the business problem, such as improving store layout or product placement. section 4.8
  • Discover and load historical transactions, then convert invoice-style records into a format association-rule algorithms can consume. section 4.8
  • Generate and filter rules using support, confidence, lift, and conviction; higher values indicate stronger or more useful relationships. section 4.11
  • Choose a mining approach: Apriori uses bottom-up candidate generation, ECLAT uses depth-first search, and F-P growth uses a frequent-pattern tree. section 4.11

Improving supermarket layout

If transactions show that customers frequently buy milk and bread together, placing bread near the milk counter can make products easier to find and guide a planogram. The same pattern can inform marketing or pricing decisions. section 4.8 section 4.11

Table 4.20 Example of invoices generated in a real-world retail store
Invoice number
Date
Items
Amount
1001
01-Jun-21
Milk, Eggs, Cheese, Bread
$10
1002
01-Jun-21
Bread, Bananas, Apples, Butter
$15
1003
01-Jun-21
Butter, Carrots, Cheese, Eggs, Bread, Milk, Bananas
$19
1004
01-Jun-21
Milk
$1
1005
01-Jun-21
Bread
$0.80

Inspect invoice records containing dates, item lists, and amounts to see the transaction data that must be transformed before rule mining. section 4.8

How Data Without Labels covers it

How deep it goes
Explains rule structure, evaluation metrics, transaction preparation, business framing, and algorithm choices without detailing complete implementations.
Examples
Uses beer and diapers, milk and bread, supermarket invoices, store planograms, recommendations, and symptom relationships.
What it assumes
Assumes historical transaction records and introduces association-rule structure, business framing, and data-format requirements.
What you can do after
Apply association-rule metrics and algorithms to transaction data and translate frequent item relationships into business actions.
How it connects
Connects association rules with Apriori, ECLAT, F-P growth, sequence rule mining, planograms, and recommendation systems.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.