Weka CSV to Arff conversion : IllegalArgumentException: Attribute names are not unique

saket picture saket · Oct 20, 2012 · Viewed 12.5k times · Source

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

Answer

saket picture saket · Oct 21, 2012

There was no header fields in the csv. So I created a script and added column0,column1,...,class in the Csv file first line. Then opened that generated csv file in weka.