GithubHelp home page GithubHelp logo

Items missing in the output about fp-growth HOT 7 OPEN

evandempsey avatar evandempsey commented on August 21, 2024 2
Items missing in the output

from fp-growth.

Comments (7)

Billy4195 avatar Billy4195 commented on August 21, 2024 1

I met the same issue now.
@ZaxR , @yanxiang007 Did you find any project can do this job??
Otherwise I want to fixed this bug.

from fp-growth.

Billy4195 avatar Billy4195 commented on August 21, 2024 1

Hey guys, I had fixed one of the problem in my own repo, now it can show the "7" itemset which @yanxiang007 mentioned , but it still exists some other bugs.

I am using orange3-associate as an alternate.
Hope this information can help you.

from fp-growth.

ZaxR avatar ZaxR commented on August 21, 2024

I'm experiencing a similar issue of missing patterns - so far, only for patterns of length 1. Too much data to post here, but the project can be found here. Here's the issue I came across, though:

I get valid patterns of:

('carrots', 'lettuce', 'garlic'): 10
('carrots', 'lettuce'): 10
('carrots', 'garlic'): 13
('lettuce', 'garlic'): 10

yet there are no single-item patterns for ('carrots',), ('lettuce',), or ('garlic'). Given that any sub-pattern should be at least as frequent as its parent, I would expect all three to show up and with higher counts.

Is there a way to correct this? Thank you for the package and support!

from fp-growth.

ZaxR avatar ZaxR commented on August 21, 2024

I ended up using Christian Borgelt's PyFIM; however, I still think this implementation is worth fixing/upgrading for a few reasons:

  1. The association rules option only produces association rules with a single consequent (what I personally needed, but not "complete").
  2. The implementation above is more intended as a command line program, and figuring out some of the parameter options in python (even with 'help') takes a bit of guesswork (particularly because its compiled from C++) .
  3. pip install is nice...

from fp-growth.

evandempsey avatar evandempsey commented on August 21, 2024

Guys,
Thanks for your engagement with this.
To be perfectly honest, I didn't know what I was doing when I put this project up here.
I need to clear a block of time to go through bug reports and pull requests and push tests, fixes and a new release to PyPI.

If anyone wants to help, shout!

from fp-growth.

yanxiang007 avatar yanxiang007 commented on August 21, 2024

from fp-growth.

Rbain2 avatar Rbain2 commented on August 21, 2024

Hi All,
In working on this issue for my own work I found a problem with the generate_association rules module specifically with the line below

if confidence >= confidence_threshold:
rules[antecedent] = (consequent, confidence)

This only allows effectively one rule per item and thus the higher order rules per item where they exist are essentially over riding the simple 1 -> 1 items.
I addressed this by changing the code so that instead of setting the dict value each time - if a rule already exists for an item I then append the new rule as a list to the dict value as follows

if confidence >= confidence_threshold:
rule1=(consequent, confidence)
rule1=list(rule1)
if antecedent in rules:

                        rules[antecedent].append(rule1)
                    else:
                        rules[antecedent]=rule1

The rules of course then have to be unravelled in a slightly more complex manner but this worked well .
First rule is value[0] -> value[1] . Subsequent rules are stored as list in value[n] so the unravelling is as follows where prel is the antecedent list ,postl is the consequent list and confl is the confidence list

for key,value in rules.iteritems():

    if len(value)> 2: #If item has more than 1 rule 
        for i in range(2,len(value)):# For rule 2 and subsequent rules 
            prel.append(key)
            postl.append(value[i][0])
            confl.append(value[i][1])

    prel.append(key)
    postl.append(value[0])
    confl.append(value[1])

hope this helps

from fp-growth.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.