Weka error opening arff file

user2154826 picture user2154826 · Oct 14, 2013 · Viewed 8.5k times · Source

I'm trying to open an arff file in weka but I get two errors. The first, "file not recognised as an arff file. Reason: nominal value not declared in header, read Token[25], line 772"

The curious thing is that I delete the 25 element and try again, it says "file not recognised as an arff file. Reason: premature end of line, read Token[EOL], line 773"

Anyone knows what is happening?

This is the file: https://www.dropbox.com/s/utmopltp3eljtyq/hegazkinak.arff

Answer

Ivan Mushketyk picture Ivan Mushketyk · Oct 14, 2013

There is an example of arff file in the documentation:

   @RELATION iris

   @ATTRIBUTE sepallength  NUMERIC
   @ATTRIBUTE sepalwidth   NUMERIC
   @ATTRIBUTE petallength  NUMERIC
   @ATTRIBUTE petalwidth   NUMERIC
   @ATTRIBUTE class        {Iris-setosa,Iris-versicolor,Iris-virginica}
   @DATA
   5.1,3.5,1.4,0.2,Iris-setosa
   4.9,3.0,1.4,0.2,Iris-setosa

As you can see, a class label is presented as a string label (e.g. "Iris-setora") at the end of each line. In the file that you presented there is no class label at the end of a line. This can be the source of the problem.