7

I have a Csv file download from http://yann.lecun.com/exdb/mnist/index.html. I need to convert it to arff file format.

I tried running

java weka.core.converters.CSVLoader /home/saket/Documents/Assignment/NIST7000 > /home/saket/Documents/Myfile.arff 

but it's giving following error

java.lang.IllegalArgumentException: Attribute names are not unique! Causes: '0' '0' '0' '0' '0' '0' '0' 

Then I tried using http://weka.wikispaces.com/Converting+CSV+to+ARFF java code. BUt still same error came.

Can someone please suggest what i am doing wrong

4

3 に答える 3

7

csvにはヘッダーフィールドはありませんでした。そこで、スクリプトを作成し、Csvファイルの最初の行にcolumn0、column1、...、classを追加しました。次に、生成されたcsvファイルをwekaで開きました。

于 2012-10-21T18:46:02.987 に答える
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".

于 2017-03-02T23:47:41.980 に答える
0

It happens when attribute name is same, in more than one column of the excel sheet. Just rename the column name which are same. It should be unique.I changed my third column name, which was same.Please have a look in screenshot attached.This can be done via an script too for large set of dataset. This worked for me.enter image description here

enter image description here

于 2018-04-23T12:09:59.110 に答える