我通过在ANSI中保存文件并删除第一行并将属性更改为数字而不是实际如下,甚至通过在第29行添加“}”符号来尝试在线提出的解决方案,但我仍然得到以下内容我尝试导入arff文件时WEKA中的错误。
错误讯息:
无法将结构确定为arff(原因:java.io.IOException:}在枚举结束时预期,读取令牌[EOL],第29行)
ARFF文件:
@relation Pilot
@attribute Gender? { Male (Lelaki),Female (Perempuan) }
@attribute Age? numeric
@attribute 1# numeric
@attribute 2# numeric
@attribute 22#{Nothing_to_Carry,Need_to_carry_many_things}
@attribute 14# numeric
@attribute 3# numeric
@attribute 18# numeric
@attribute 17# numeric
@attribute 4# numeric
@attribute 5# numeric
@attribute 15# numeric
@attribute 16# numeric
@attribute 19# {No,Yes}
@attribute 20# {Yes,No}
@attribute 6# numeric
@attribute 7# numeric
@attribute 8# numeric
@attribute 9# numeric
@attribute 11# numeric
@attribute 10# numeric
@attribute 12# numeric
@attribute 13# numeric
@attribute 21#{No,Yes}
@attribute Physical_Disability{Partially_Visually_Impaired,Blind}
@attribute 23#{Yes,Don't_know,No}
@attribute 24#{No,Don't know,Yes}
@attribute 25#{Yes,No}
}
@data
Male,36,2,3,Nothing_to_Carry,1,3,2,3,3,2,1,2,No,Yes,3,5,5,4,5,4,3,3,No,Partially_Visually_Impaired,Yes,No,Yes
Female,44,3,3,Nothing_to_Carry,3,4,3,3,4,3,1,1,No,Yes,4,4,3,2,3,3,4,4,No,Partially_Visually_Impaired,Yes,No,Yes
Male,34,3,4,Nothing_to_Carry,3,3,2,1,4,3,2,1,No,Yes,1,4,3,1,5,3,4,5,No,Blind,Yes,Don't know,Yes
Male,56,1,3,Nothing_to_Carry,3,4,4,4,4,3,3,3,No,Yes,1,5,5,5,3,3,5,1,Yes,Blind,Don't know,Yes,Yes
Male,54,5,5,Nothing_to_Carry,1,1,1,5,5,5,1,5,No,Yes,1,5,5,1,5,1,1,5,Yes,Blind,Yes,No,Yes
Female,39,1,1,Nothing_to_Carry,1,2,1,5,3,5,5,5,Yes,Yes,3,3,5,1,1,5,5,5,Yes,Blind,Yes,Yes,Yes
Male,49,2,3,Nothing_to_Carry,2,2,3,4,4,4,3,3,No,Yes,1,3,3,4,3,3,4,4,No,Partially_Visually_Impaired,No,No,Yes
Male,68,5,4,Nothing_to_Carry,4,4,2,5,2,3,3,3,No,No,1,2,3,1,3,3,3,4,No,Blind,Yes,Don't know,No
Male,44,1,1,Nothing_to_Carry,1,3,3,3,3,3,3,1,No,Yes,1,5,4,4,3,4,2,2,Yes,Blind,Yes,Yes,Yes
Male,45,1,1,Nothing_to_Carry,1,2,1,1,1,1,3,1,No,Yes,5,5,1,5,5,5,5,5,No,Partially_Visually_Impaired,No,No,Yes
Male,59,3,4,Nothing_to_Carry,4,3,3,3,3,3,3,3,No,No,2,1,3,1,4,3,4,2,No,Blind,Yes,Yes,No
Male,38,3,3,Nothing_to_Carry,4,4,3,4,4,3,3,3,No,Yes,4,2,4,1,2,3,3,3,No,Partially_Visually_Impaired,Yes,No,Yes
Male,29,4,2,Nothing_to_Carry,4,4,4,4,3,4,4,3,Yes,Yes,4,3,3,3,3,3,4,3,No,Blind,Yes,No,Yes
}
请指教......谢谢。
答案 0 :(得分:1)
答案 1 :(得分:1)
下次考虑编辑问题而不是在答案中写一个问题。
问题是您应该将属性23和24的Don't_know
和Don't know
更改为Dont_know
。这意味着您必须跳过标点符号和空格。
此外,您需要将此@attribute Gender? { Male(Lelaki),Female(Perempuan) }
更改为@attribute Gender? { Male,Female }
或者您的数据应该是Male(Lelaki),36,2,3,Nothing_to_Carry,1,3,...
而不是Male,36,2,3,Nothing_to_Carry,1,3...
答案 2 :(得分:1)
尝试从 Weka Software 打开您的 .csv 文件数据集。
它有一些步骤要做
此后不会出现此类错误。使用Weka软件可以轻松进行预处理、分类、关联规则。