我正在使用mlxtend
查找关联规则:
这是代码:
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) ]
输出:
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
我给了一个min support=0.4
. antecedentsupport
和consequentsupport
和有什么区别support
?
lift and leverage?
如何判断它的好坏是什么意思?
信心我可以理解这是输出中第一条规则一起发生的次数C
和次数。B
? 那是对的吗