Closed rmenoli closed 7 years ago
Hi After I have found the rules with a minimum support and a minimum confidence, I would sort the rules found by confidence, is it possible?
It is the code that I wrote rules = list(apriori(dataset, min_support=0.003, min_confidence=0.3, min_lift=1.01)) Ty
rules = list(apriori(dataset, min_support=0.003, min_confidence=0.3, min_lift=1.01))
def useattr(attr): def kicker(obj): tmp=getattr(obj, attr) return tmp [0][2] return kicker rules = sorted(rules, key=useattr('ordered_statistics'))
Hi After I have found the rules with a minimum support and a minimum confidence, I would sort the rules found by confidence, is it possible?
It is the code that I wrote
rules = list(apriori(dataset, min_support=0.003, min_confidence=0.3, min_lift=1.01))
Ty