我从http://yann.lecun.com/exdb/mnist/index.html下载了一个Csv文件。我需要将其转换为arff文件格式。
我试过了
java weka.core.converters.CSVLoader /home/saket/Documents/Assignment/NIST7000 > /home/saket/Documents/Myfile.arff
但是它给出了以下错误
java.lang.IllegalArgumentException: Attribute names are not unique! Causes: '0' '0' '0' '0' '0' '0' '0'
然后我尝试使用http://weka.wikispaces.com/Converting+CSV+to+ARFF java代码。 BUt仍然出现同样的错误。
有人可以建议我做错了吗
答案 0 :(得分:7)
csv中没有标题字段。所以我创建了一个脚本并在Csv文件的第一行添加了column0,column1,...,class。 然后在weka中打开生成的csv文件。
答案 1 :(得分:4)
I have encountered the same exception but with a different reason. I used "class" as the attribute name, but this word also appeared in my data as a string (after @data) and Weka did not correctly separate attribute and data. Solved by simply renaming "class" attribute to something else like "s_label".
答案 2 :(得分:0)