Confidence
When association rules are mined from transaction data, not every pattern is equally convincing. Confidence is the measure that asks: “If the left side of a rule happens, how reliably does the right side happen too?”
What confidence measuresFor a rule like {bread, peanut butter} → {jam}, confidence is the conditional probability that a basket contains jam given that it already contains bread and peanut butter. In formula form, it is:
confidence(X → Y) = support(X ∪ Y) / support(X)
So if 100 baskets contain bread and peanut butter, and 60 of those also contain jam, the rule’s confidence is 0.60. A higher value means the rule is more reliable as an implication from left to right. That direction matters: X → Y and Y → X usually have different confidence values.
Why it mattersConfidence is one of the main filters used in algorithms such as Apriori and FP-Growth. It helps decide which discovered rules are worth keeping.
- In market basket analysis, high-confidence rules can support product bundling or shelf placement.
- In recommendation settings, they help suggest items that commonly follow a user’s current choices.
- In clickstream or event data, they reveal likely next actions after a given behavior pattern.
Confidence can look strong even when a rule is not truly interesting. If milk appears in nearly every basket, then many rules pointing to milk will have high confidence simply because milk is common. That is why confidence is usually interpreted alongside support and especially lift, which checks whether the co-occurrence is stronger than chance. In Python, this appears directly in tools like mlxtend.frequent_patterns.association_rules, where confidence is a standard output column for evaluating rules.
Confidence is the conditional probability that the consequent of an association rule appears in a transaction given that the antecedent appears. For a rule like A → B, confidence equals support(A ∪ B) divided by support(A). It measures the rule’s predictive reliability within observed data. In association rule learning, confidence is essential for filtering weak rules and prioritizing patterns that are actionable, though high confidence alone does not guarantee a truly informative association.
Imagine a supermarket noticing that when people buy burger buns, they also often buy ketchup. Confidence is the number that tells you how often that second part is true once the first part has happened.
In AI pattern-finding, especially when looking through shopping baskets or other grouped data, confidence measures how reliable a rule seems. If a rule says “people who buy X also buy Y,” confidence asks: “Out of the people who bought X, how many also bought Y?” A high confidence means the pattern shows up a lot when the starting item is present. It matters because it helps separate weak hunches from patterns that are actually useful.