Weka (machine learning)
Making arff file
Posts  1 - 1  of  1
jbrixey1


I am making a sparse arff file but it will not load into Weka. I get the error
weka.core.converters.CSVLoaderfailed to load 'ARFF file for question data.txt'. Reason: wrong number of values. Read 12, expected 1, read Token[EOL], line 477

Line 476 contains @attribute class, I don't know why it would only expect 1 there. What am I doing wrong? My file looks like this:

%ARFF file for questions data
%

@relation brazilquestions

@attribute att0 numeric
@attribute att1 numeric
@attribute att2 numeric
@attribute att3 numeric

%%%%there are 469 attributes which represent my bag of words

@attribute class {Odontologia_coletiva, Periodontia, Pediatria, Estomatologia,
Dentistica, Ortodontia, Endodontia, Cardiologia, Terapeutica,
Terapeutica_medicamentosa, Odontopediatria, Cirurgia}


@data
{126 1, 147 1, 199 1, 56 1, 367 1, 400 1 , Estomatologia}
{155 1, 76 1, 126 1, 78 1, 341 1, 148 1, Odontopediatria}
%and then 81 more instances of data


I included the @data portion so you could see a portion of the rest of the file. The first number represents the word in my bag of words (it is an index position in an array, so 126 actually means crianca) the second number is the frequency of that word in the particular question. Each line of data is a different length since each question from the original word data contains different amounts of words.

Any ideas about what is wrong with my syntax with the @attribute class line? I followed the example exactly from the book Data Mining by Witten/Frank/Hall. Thanks in advance!
Save
Cancel
Reply
 
x
OK