I am using mlxtend
to find association rules:
Here is the code:
df = apriori(dum_data, min_support=0.4, use_colnames=True)
rules = association_rules(df, metric="lift", min_threshold=1)
rules2=rules[ (rules['lift'] >= 1) & (rules['confidence'] >= 0.7) ]
Output:
antecedents consequents antecedentsupport consequentsupport support confidence lift leverage conviction
frozenset({'C'}) frozenset({'B'}) 0.63 0.705 0.45 0.726 1.030 0.013 1.077
frozenset({'A'}) frozenset({'B'}) 0.98 0.705 0.69 0.70 1.003 0.0007 1.00081
frozenset({'A', 'C'}) frozenset({'B'}) 0.63 0.705 0.45 0.72 1.030 0.013 1.0776
I have given a min support=0.4
. What is the difference between antecedentsupport
, consequentsupport
and support
?
What do mean by lift and leverage?
How to judge if its good or bad?
Confidence I can understand that is how many times C
and B
occured together for first rule in output. ? Is that correct