問題タブ [pattern-mining]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
204 参照

data-mining - シーケンシャル パターンまたはアイテムセット fp ツリー

FP 成長アルゴリズムは、アイテムセット マイニングに使用されます。これらのアルゴリズムをアイテムセット マイニングの代わりにシーケンシャル パターン マイニングに使用する方法はありますか?

0 投票する
1 に答える
136 参照

apriori - Candidate set generation in Apriori algorithm

I am trying to implement Apriori algorithm in Java, and have problems with generating Candidate itemsets. To create candidates for k-itemset I use all combinations of k-1 and 1-itemsets. For example, for Frequent 1-itemset: bread:9, milk:9, coffee:9, sugar:10.

Candidate 2-itemsets generated should be: bread milk, bread coffee, bread sugar, milk coffee, milk sugar, coffee sugar.

But my code returns: bread coffee, bread milk, bread sugar, coffee bread, coffee milk, coffee sugar, milk bread, milk coffee, milk sugar, sugar bread, sugar coffee, sugar milk (all permutations; returns both bread milk and milk bread, however, these two are the same thing).

My code:

Is there a way to modify this method to get rid of repetitive itemsets? Please advise. Thank you.