-->

通过使用项目集的标题的关联规则迭代(Iterate through association rule

2019-09-27 14:28发布

我有像这样的输入数据帧

我生成使用熊猫关联规则

frequent_itemsets = apriori(df, min_support=0.2, use_colnames=True)
rules = association_rules(frequent_itemsets, metric= "confidence", min_threshold = 0.6 )

我的输出只生成每个项目集的规则的值无需标记的报头。 它看起来像下面。 我的问题是1 - 我要标注的前因和后项与他们的头名(年龄,AL,性别,...等),因为我不能所有的输出数字区分。 例:

Age = 20, Smoke = n   => Chol = y

2 - 如果我有以前的规则,我想在我的输出做了一些计算上的所有规则重复的,我怎么能做到这一点给我输出的信息

文章来源: Iterate through association rules using the header of an itemset