New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-fpgrowth

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-fpgrowth

FPGrowth frequent itemset mining algorithm implementation in TypeScript / JavaScript.

1.0.0
Source
npm
Version published
Weekly downloads
5.8K
3.36%
Maintainers
1
Weekly downloads
 
Created
Source

Node-FPGrowth

FPGrowth Algorithm implementation in TypeScript / JavaScript.

Getting Started

Installing

This is a Node.js module available through the npm registry.

Installation is done using the npm install command:

$ npm install --save node-fpgrowth

Example of use


import { FPGrowth, Itemset, IFPGrowthResults } from 'node-fpgrowth';

let transactions: number[][] = [
    [1,3,4],
    [2,3,5],
    [1,2,3,5],
    [2,5],
    [1,2,3,5]
];

// Execute FPGrowth with a minimum support of 40%. Algorithm is generic.
let fpgrowth: FPGrowth<number> = new FPGrowth<number>(.4);

// Returns itemsets 'as soon as possible' through events.
fpgrowth.on('data', (itemset: Itemset<number>) => {
    // Do something with the frequent itemset.
    let support: number = itemset.support;
    let items: number[] = itemset.items;
});

// Execute FPGrowth on a given set of transactions.
fpgrowth.exec(transactions)
    .then( (result: IFPGrowthResults<number>) => {
        // Returns both the collection of frequent itemsets and execution time in millisecond.
        let frequentItemsets: Itemset<number>[] = result.itemsets;
        let executionTime: number = result.executionTime;
    });

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

fpgrowth

FAQs

Package last updated on 12 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts