Gagan
Gagan

Reputation: 1923

Orange python data mining: TypeError: invalid sequence element at 0

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

Answers (1)

K3---rnc
K3---rnc

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

Related Questions