I would really appreciate some help.
i'm having problem with an output from pymining / itemmining which creates association rules from transaction baskets. The output (rules) i'm getting is a list like this:
[(frozenset({'A', 'B', 'C', 'D', 'E'}), frozenset({'X'}), 55, 0.8870967741935484), (frozenset({'U', 'Z', 'D'}), frozenset({'G', 'Q'}), 55, 0.5445544554455446),...]
which means if a customer has bought items A B C D E he is likely to buy next item X.. (this happens 55 times and has a confidence of .55)
i've tried converting my list to an array using replace functions:
rules2 = str(rules)
rules2 = rules2.replace('(frozenset({', '[')
but i dont think it's correct way to convert to a proper array?
I'm wanting to match the above list with a file of fresh transactions which looks like this: array([['D', 'F', 'G'], ['A', 'B'], dtype=object)
So that if a customer has bought products D F G i know what we should recommend next...
Many thanks who can help i'm really stuck! I tried to convert rules to dataframe but i get an error msg saying 'InterfaceError: Error binding parameter 1 - probably unsupported type.' when i try to query it
