I am using fpgrowth
module from Orange3-Associate to find the rules from transactions in a file. I am using this script:
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)]
However, when I print(rules)
, Consequent Q
shows as list of 2 or more items. Output:
[3, 5], [1, 2], 1, 1.0
Why is this occurring? Isn't the Consequent supposed to be only 1 item?