【发布时间】:2014-08-12 04:12:53
【问题描述】:
我正在制作一个稀疏的 arff 文件,但它不会加载到 Weka。我收到错误消息,我在 @attribute 类行中的值数量错误,它期望 1 并拒绝接收 12。我做错了什么?我的文件如下所示:
%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
关于我的语法有什么问题有什么想法吗?我完全遵循了 Witten/Frank/Hall 的《数据挖掘》一书中的示例。提前致谢!
【问题讨论】:
-
你能写出错误吗?
-
错误显示:weka.core.converters.CSVLoaderfailed to load 'ARFF file for question data.txt'。原因:值的数量错误。读取 12,预期 1,读取 Token[EOL],第 477 行。
-
第 477 行为空,但第 476 行包含带有@attribute 类的行
-
你试过放一个有7个属性的@data吗??
-
数据代表问题,所有问题都有不同的值与之关联,因为每个问题都有不同的词(这些是属性)和词频。所以数据实际上是(word1频率,word2频率,...,问题的分类)
标签: weka sparse-matrix arff