Data ScienceClustering, reduction and recommendations

Association rules: compare lift, confidence and support

PK
Pankit Kumar
Sr. Data Scientist at Parexel (a Goldman Sachs–backed company) · 20 September 2026 · 2 min read
Technically reviewed by Ishaan Sharma
In this article (3 sections)

Association rules summarize co-occurrence. Support measures how often both sides appear. Confidence measures how often the consequent appears when the antecedent appears. Lift compares that confidence with the consequent's overall prevalence.

Calculate all three on the same baskets

Our authored dataset contains 100 baskets. Coffee appears in 50, tea in 30 and cake in 60. Coffee and cake occur together in 30; tea and cake occur together in 20.

RuleSupportConfidenceLift
Coffee → cake0.300.601.00
Tea → cake0.200.66671.1111
Cake → coffee0.300.501.00

Coffee-to-cake confidence is 60%, which sounds substantial until we notice that cake already appears in 60% of all baskets. Lift is exactly one: knowing coffee does not change cake prevalence in this construction. Tea-to-cake has lower support but lift above one.

python
from unsupervised_cases import association_case

r = association_case()
assert r['transactions'] == 100
rules = {(row['antecedent'], row['consequent']): row for row in r['rules']}
assert rules[('coffee', 'cake')]['support'] == .3
assert rules[('coffee', 'cake')]['confidence'] == .6
assert rules[('coffee', 'cake')]['lift'] == 1
print(r)

Run the exact basket construction in the unsupervised lab. The arithmetic is descriptive and does not estimate the result of a promotion.

Control the rule-search process

Define a transaction window and item hierarchy before mining. A weekly customer basket answers a different question from a single receipt. Product bundles, refunds and quantities need explicit handling.

Set minimum support to avoid unstable rules based on a handful of baskets. High lift can occur for extremely rare items; always report counts. Searching thousands of itemsets creates many chance patterns, so validate rules on a later period and check stability.

Direction matters for confidence: cake-to-coffee is 50%, while coffee-to-cake is 60%. Lift is symmetric for the pair even though the rule directions differ. Neither direction establishes causality. Placement, discounts and inventory can produce co-occurrence.

Before action, estimate margin, substitution, stock constraints and incremental effect through an experiment. A rule can be operationally useless even with strong association if the items are already purchased together without intervention.

Exercise: add a rare pair with support 0.02 and lift five. Compare expected affected baskets with the tea rule. Then hold out a later basket period and test whether support, confidence and lift remain within predeclared ranges.

NeuraPath's Data Science course teaches association rules with denominators and validation. Confidence alone is never the whole story.

Continue learning

This article is part of the Clustering, reduction and recommendations sequence. Use the neighbouring tasks when you need the prerequisite or the next application.

PK
Pankit Kumar
Lead Instructor, NeuraPath Academy

Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.

This article is part of our Data Science programme — 6 months. From data foundations to machine learning, deep learning and deployment.

Explore Data Science
Counselling is free · no obligation

Not sure which programme fits?

Tell us your background and we will map it to the right entry point — including saying so when a cheaper programme is the better fit. A counsellor replies within one working day.