GithubHelp home page GithubHelp logo

alexisfacques / node-fpgrowth Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 0.0 26 KB

FPGrowth Algorithm implementation in TypeScript / JavaScript.

Home Page: https://www.npmjs.com/package/node-fpgrowth

License: MIT License

TypeScript 100.00%
fpgrowth data-mining frequent-itemsets frequent-itemset-mining data-mining-algorithms fp-growth

node-fpgrowth's People

Contributors

alexisfacques avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-fpgrowth's Issues

Feat: Get related items of a given item order by support

Currently it gives me all possible itemsets.
What I want is a function that accepts an item and returns all its pairs (excluding itself) sorted in order of support
getRelatedItems(item, maxItems?)

var transactions = [
[1, 3, 4],
[2, 3, 5],
[1, 2, 3, 5],
[2, 5],
[1, 2, 3, 5]
];
getRelatedItems(1) // Output: [3, 5, 2]
getRelatedItems(2) // Output: [5, 3, 1]
getRelatedItems(3) // Output: [5, 2, 1]
getRelatedItems(4) // Output: []
getRelatedItems(5) // Output: [2, 3, 1]

Memory optimisations

Hey @alexisfacques , thanks a lot for such a nice library!
In my experiments, I have around 50-60k transactions and the algorithm stops working after some time, the process crashes with an OOM error. I have 16GB of RAM and it is all getting utilized by the library.
I understand that it's the nature of this algorithm to be inefficient in memory, but do you see any chances to make it work on a regular laptop? Some kinds of tweaks or optimizations maybe. Or use some external tools (such as databases, and file systems) for storing temporary results after each step.

Make this module runnable in the browser

Hi @alexisfacques!

This is very good work! I would like to use it in the frontend and there is an error of process.hrtime is not a function, because process is undefined.

I patched it by hand with the help of browser-process-hrtime, but I need to make this simple patch permanent.
What about including a runtime environment check in your code?
I could renounce the execution time anyway, but I failed to edit your Typescript code in my fork until here.

Regards!
noVaSon

It doen't compile

node-fpgrowth/dist/fpgrowth.d.ts(1,23): error TS2688: Cannot find type definition file for 'node'.
node-fpgrowth/dist/fpgrowth.d.ts(15,22): error TS2420: Class 'FPGrowth' incorrectly implements interface 'IFPGrowthEvents'.
Property 'on' is missing in type 'FPGrowth'.

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.