Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort the rules found by confidence #33

Closed
rmenoli opened this issue Aug 28, 2017 · 1 comment
Closed

Sort the rules found by confidence #33

rmenoli opened this issue Aug 28, 2017 · 1 comment

Comments

@rmenoli
Copy link

rmenoli commented Aug 28, 2017

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

@rmenoli rmenoli closed this as completed Aug 28, 2017
@rmenoli
Copy link
Author

rmenoli commented Aug 28, 2017

def useattr(attr):
    def kicker(obj):
        tmp=getattr(obj, attr)
        return tmp [0][2]
    return kicker

rules = sorted(rules, key=useattr('ordered_statistics'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant