无论属性名称如何,如何查找频繁项集? [英] How to find frequent itemset irrespective of attribute name?
问题描述
我有一个数据集(CSV文件),可以使用Apriori算法查找频繁的项目集。
I have a dataset (CSV file) to find frequent itemsets using Apriori algorithm.
col1, col2, col3
bread, butter,?
coke, bread, butter
我正在为此目的使用WEKA。输出采用以下格式:
I am using WEKA for this purpose. The ouput is in the following format:
...
Large Itemsets L(2):
col1=bread col2= butter 1
col1=coke col2= bread 1
col1=coke col3= butter 1
col2= bread col3= butter 1
...
但是我想要的输出是:
bread, butter 2
基本上,以上输出与它们所属的 col
。如何实现这种输出?
Basically, the above output is independent of the col
that they belong to. How can I achieve this kind of output?
推荐答案
以不同的格式设置数据格式。
Format your data differently.
Weka期望列是相同的乘积,其值为t / f(对于true,false)。然后您将获得牛奶= t->黄油= t这类的项目集。
Weka expects columns to be the same products, and the value to be t/f (for true, false). Then you get itemset of the kind milk=t -> butter=t.
请参阅Weka附带的.arff示例。
See the .arff examples included with Weka.
我想我看到了一个使用您的输入格式的ELKI示例。
I think I saw an ELKI example using your input format.
这篇关于无论属性名称如何,如何查找频繁项集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!