
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
node-fpgrowth
Advanced tools
FPGrowth frequent itemset mining algorithm implementation in TypeScript / JavaScript.
FPGrowth Algorithm frequent itemset mining algorithm implementation in TypeScript / JavaScript.
This is a Node.js module available through the npm registry.
Installation is done using the npm install
command:
npm install --save node-fpgrowth
In your TypeScript project, import and use FPGrowth
as follows. Same example with a JavaScript syntax is available here.
import { FPGrowth, Itemset } 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( (itemsets: Itemset<number>[]) => {
// Returns an array representing the frequent itemsets.
});
Node-FPGrowth is compatible with browserify and webpack.
Alternatively, you can import/serve the browserified fpgrowth-client.js
file found in the dist
folder:
<script src="./dist/fpgrowth-client.js"></script>
<script>
var transactions = [
[1, 3, 4],
[2, 3, 5],
[1, 2, 3, 5],
[2, 5],
[1, 2, 3, 5]
];
var fpg = new fpgrowth.FPGrowth(.4);
fpg.exec(transactions, function (itemsets) {
console.log(`Finished executing FPGrowth. ${itemsets.length} frequent itemset(s) were found.`);
});
</script>
git clone https://github.com/alexisfacques/Node-FPGrowth.git
cd Node-FPGrowth
npm install
npm run tsc
npm test
./dist/fpgrowth-client.js
, of the module:
npm run browserify
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
FPGrowth frequent itemset mining algorithm implementation in TypeScript / JavaScript.
The npm package node-fpgrowth receives a total of 0 weekly downloads. As such, node-fpgrowth popularity was classified as not popular.
We found that node-fpgrowth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.