Association Rule Calculator
Association rule mining is a fundamental technique in data mining and machine learning used to uncover interesting relationships or patterns between variables in large datasets. Whether you’re working in e-commerce, retail, finance, or data science, understanding association rules helps uncover hidden trends and drive smarter decisions.
This Association Rule Calculator allows you to quickly evaluate core metrics like support, confidence, lift, and conviction, which are crucial in market basket analysis and recommendation systems.
Formula
Association rules are typically represented as:
A ⇒ B
Which means “If A occurs, then B is likely to occur.”
The key metrics for evaluating association rules are:
- Support:
Indicates how frequently A and B occur together.
Support = P(A ∩ B) (usually expressed as a percentage) - Confidence:
Indicates how often B occurs when A occurs.
Confidence = P(B|A) = P(A ∩ B) / P(A) - Lift:
Measures how much more likely B is to occur with A compared to its typical frequency.
Lift = P(A ∩ B) / (P(A) × P(B)) - Conviction:
Measures the strength of implication.
Conviction = (1 – P(B)) / (1 – Confidence)
These metrics help assess the usefulness and strength of the discovered rule.
How to Use
To use the Association Rule Calculator:
- Enter Support: The frequency (in %) that both items occur together.
- Enter Confidence: The percentage that item B occurs given that item A occurs.
- Enter Lift: The strength of the rule in comparison to random chance.
- Click “Calculate”: The calculator will also compute the conviction value, a lesser-known but insightful metric.
This tool is useful for analysts, researchers, and students studying data mining.
Example
Scenario:
A retailer wants to evaluate the rule:
{Bread} ⇒ {Butter}
- Support: 15% (both Bread and Butter bought together)
- Confidence: 75% (75% of customers who buy Bread also buy Butter)
- Lift: 1.25
Step 1: Enter 15 as Support, 75 as Confidence, and 1.25 as Lift.
Step 2: Click “Calculate”
Result:
- Support: 15.00%
- Confidence: 75.00%
- Lift: 1.25
- Conviction: ~3.40
Interpretation:
There’s a strong rule between Bread and Butter. The lift > 1 and conviction > 1 show it’s meaningful and not due to chance.
FAQs
1. What is an association rule?
It’s a rule that implies a relationship between two items or events in data, like A ⇒ B.
2. What is support in association rules?
It’s the frequency that both A and B occur together in the dataset.
3. What is confidence in data mining?
It measures the reliability of the implication — how often B appears when A does.
4. What does lift indicate?
Lift shows whether B is more likely to occur with A than alone. A lift > 1 means a strong rule.
5. What is conviction in rule mining?
Conviction evaluates the implication strength based on the frequency B does not occur.
6. Can lift be less than 1?
Yes. A lift < 1 means A and B are negatively correlated.
7. What does a lift of 1 mean?
It means A and B occur independently of each other.
8. When is a rule considered strong?
When it has high confidence, high lift (>1), and high support (often >10%).
9. Is high support always good?
Not always — it must be paired with high confidence and lift to be meaningful.
10. What is market basket analysis?
A data mining technique that finds associations between items customers buy together.
11. What industries use association rules?
Retail, e-commerce, banking, healthcare, and any sector with large transaction datasets.
12. How do I calculate support manually?
Support = (Transactions containing both A and B) / (Total transactions)
13. How is confidence different from probability?
Confidence is conditional — it tells you the probability of B given A.
14. Can I use decimals instead of percentages?
Yes, just make sure consistency in units is maintained.
15. What’s a good conviction score?
A conviction > 1 suggests predictive power; higher is generally better.
16. Are these metrics only for two-item rules?
No, they can apply to rules with multiple items on either side (e.g., A, C ⇒ B).
17. Can I use this calculator for Apriori or FP-Growth rules?
Yes — those algorithms produce rules you can evaluate using these metrics.
18. Is lift affected by dataset size?
Lift is normalized, so it’s consistent across different dataset sizes.
19. Can a rule have high support but low confidence?
Yes. This might happen if A is frequent but doesn’t always lead to B.
20. What does a conviction < 1 mean?
It means the rule performs worse than random guessing.
Conclusion
Understanding association rules is a cornerstone of data mining and intelligent decision-making. Metrics like support, confidence, lift, and conviction help determine the reliability and strength of relationships between variables in your dataset.
