【发布时间】:2019-01-12 03:28:01
【问题描述】:
我正在使用Orange3-Associate 中的fpgrowth 模块从文件中的事务中查找rules。我正在使用这个脚本:
from orangecontrib.associate.fpgrowth import *
transactions = [[1, 2, 5],
[2, 4],
[2, 3],
[1, 2, 4],
[1, 3],
[2, 3],
[1, 3],
[1, 2, 3, 5],
[1, 2, 3]]
itemsets = dict(frequent_itemsets(transactions, .2))
rules = [(list(P), list(Q), supp, conf) for P, Q, supp, conf in association_rules(itemsets, .5)]
但是,当我 print(rules) 时,结果 Q 显示为 2 个或更多项目的列表。输出:
[3, 5], [1, 2], 1, 1.0
为什么会这样?结果不是应该只有一项吗?
【问题讨论】:
标签: python python-3.x data-mining fpgrowth