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

Is it a error in generateRules? #15

Open
brisksea opened this issue Apr 12, 2020 · 0 comments
Open

Is it a error in generateRules? #15

brisksea opened this issue Apr 12, 2020 · 0 comments

Comments

@brisksea
Copy link

In chapter 11

def generateRules(L, supportData, minConf=0.7):  #supportData is a dict coming from scanD
    bigRuleList = []
    for i in range(1, len(L)):#only get the sets with two or more items
        for freqSet in L[i]:
            H1 = [frozenset([item]) for item in freqSet]
            if (i > 1):
                rulesFromConseq(freqSet, H1, supportData, bigRuleList, minConf)
            else:
                calcConf(freqSet, H1, supportData, bigRuleList, minConf)
    return bigRuleList

When the frequent set is like {1,2,3}, it can't generate the rules like {1,2}->3.
Shoule the snippet

            if (i > 1):
                rulesFromConseq(freqSet, H1, supportData, bigRuleList, minConf)
            else:
                calcConf(freqSet, H1, supportData, bigRuleList, minConf)

change to

            rulesFromConseq(freqSet, H1, supportData, bigRuleList, minConf)
            if (i > 1):
                calcConf(freqSet, H1, supportData, bigRuleList, minConf)
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