How to convert the nominal data from csv to arff format?

138 views Asked by At

one of the attribute was 'first year, second year'. when i tried to open into Weka, i got the errors the following error message "unable to determine structure as arff(Reasons:java.lang.IllegalArgumentException: A nominal attribute (year) cannot have duplicate labels (year)".

i followed all of the steps for the file to be opened in Weka as i did it with the numerical value of the same datasets that was worked. i followed the below steps:

  1. @relation (Name)

  2. @attribute year {first year, second year}

  3. @data first year second year

1

There are 1 answers

3
fracpete On

Nominal vales that contain spaces must be quoted, as per:

https://waikato.github.io/weka-wiki/formats_and_processing/arff_stable/#nominal-attributes

In your case:

@attribute year {'first year', 'second year'}

Also, Weka can load CSV files. Either natively or via the common-csv Weka package.