Reputation: 1923
I am getting the following error when i am loading the pandas dataframe for the associated rule.
TypeError: invalid sequence element at 0
Following is my code:
rules = Orange.associate.AssociationRulesSparseInducer(df, support=0.3)
print "%4s %4s %s" % ("Supp", "Conf", "Rule")
for r in rules[:5]:
print "%4.1f %4.1f %s" % (r.support, r.confidence, r)
df only has the numerical values and majorly binary.
Upvotes: 1
Views: 171
Reputation: 7049
Orange.associate.AssociationRulesSparseInducer
doesn't work with pandas DataFrames.
Use Orange3-Associate to infer association rules from list of lists
or numpy.ndarray
or scipy.sparse.spmatrix
, all of which a dataframe can easily be converted to.
Upvotes: 2