This implementation does not generate k-candidates as efficiently as it possibly could, as it adopts a brute-force approach: Every k-itemset is considered as a potential candidate, and an additional step is required to prune the unnecessary ones. More information about this question here.
The Apriori Algorithm is a great, easy-to-understand algorithm for frequent-itemset mining. However, faster and more memory efficient algorithms such as the FPGrowth Algorithm have been proposed since it was released.
If you need a more efficient frequent-itemset mining algorithm, consider checking out my implementation of the FPGrowth Algorithm.
Installation is done using the
npm install command:
$ npm install --save node-apriori
Example of use
;let transactions: number =1342351235251235;// Execute Apriori with a minimum support of 40%. Algorithm is generic.let apriori: Apriori<number> = <number>4;// Returns itemsets 'as soon as possible' through events.apriori;// Execute Apriori on a given set of transactions.apriori;
This project is licensed under the MIT License - see the LICENSE file for details