将 arff 文件打开到 weka 时出错
Errors when opening arff file into weka
每当在 weka 中打开此文件时,都会不断收到错误“未被识别为 'Arff data files' 文件。原因:预期数字,阅读 Token[M],第 16 行。但是,每当我尝试纠正错误时,都会弹出另一个错误。对此很陌生,任何人都知道我似乎在哪里犯了错误。感谢帮助。
@RELATION abalone
@ATTRIBUTE sex REAL
@ATTRIBUTE length REAL
@ATTRIBUTE diameter REAL
@ATTRIBUTE height REAL
@ATTRIBUTE wholeWeight REAL
@ATTRIBUTE shuckedWeight REAL
@ATTRIBUTE visceraWeight REAL
@ATTRIBUTE shellWeight REAL
@ATTRIBUTE rings REAL
@ATTRIBUTE class { Male,Female,Infant }
@DATA
M,0.455,0.365,0.095,0.514,0.2245,0.101,0.15,15
M,0.35,0.265,0.09,0.2255,0.0995,0.0485,0.07,7
F,0.53,0.42,0.135,0.677,0.2565,0.1415,0.21,9
M,0.44,0.365,0.125,0.516,0.2155,0.114,0.155,10
I,0.33,0.255,0.08,0.205,0.0895,0.0395,0.055,7
I,0.425,0.3,0.095,0.3515,0.141,0.0775,0.12,8
F,0.53,0.415,0.15,0.7775,0.237,0.1415,0.33,20
F,0.545,0.425,0.125,0.768,0.294,0.1495,0.26,16
M,0.475,0.37,0.125,0.5095,0.2165,0.1125,0.165,9
F,0.55,0.44,0.15,0.8945,0.3145,0.151,0.32,19
您有 10 个属性行,但您的数据中只有 9 个属性。
此外,在您的数据中,代码是 M、F、I,但您在属性声明中指出它们是男性、女性、婴儿。
我猜你认为你只是将 class 分配给 sex,但 Weka 中的 class 变量自动成为最后一个变量。我在下面为您重新安排了此内容,并确认它会正确加载。
@relation 'abalone'
@attribute length numeric
@attribute diameter numeric
@attribute height numeric
@attribute wholeWeight numeric
@attribute shuckedWeight numeric
@attribute visceraWeight numeric
@attribute shellWeight numeric
@attribute rings numeric
@attribute sex {M,F,I}
@data
0.455,0.365,0.095,0.514,0.2245,0.101,0.15,15,M
0.35,0.265,0.09,0.2255,0.0995,0.0485,0.07,7,M
0.44,0.365,0.125,0.516,0.2155,0.114,0.155,10,M
0.475,0.37,0.125,0.5095,0.2165,0.1125,0.165,9,M
0.53,0.42,0.135,0.677,0.2565,0.1415,0.21,9,F
0.53,0.415,0.15,0.7775,0.237,0.1415,0.33,20,F
0.545,0.425,0.125,0.768,0.294,0.1495,0.26,16,F
0.55,0.44,0.15,0.8945,0.3145,0.151,0.32,19,F
0.33,0.255,0.08,0.205,0.0895,0.0395,0.055,7,I
0.425,0.3,0.095,0.3515,0.141,0.0775,0.12,8,I
每当在 weka 中打开此文件时,都会不断收到错误“未被识别为 'Arff data files' 文件。原因:预期数字,阅读 Token[M],第 16 行。但是,每当我尝试纠正错误时,都会弹出另一个错误。对此很陌生,任何人都知道我似乎在哪里犯了错误。感谢帮助。
@RELATION abalone
@ATTRIBUTE sex REAL
@ATTRIBUTE length REAL
@ATTRIBUTE diameter REAL
@ATTRIBUTE height REAL
@ATTRIBUTE wholeWeight REAL
@ATTRIBUTE shuckedWeight REAL
@ATTRIBUTE visceraWeight REAL
@ATTRIBUTE shellWeight REAL
@ATTRIBUTE rings REAL
@ATTRIBUTE class { Male,Female,Infant }
@DATA
M,0.455,0.365,0.095,0.514,0.2245,0.101,0.15,15
M,0.35,0.265,0.09,0.2255,0.0995,0.0485,0.07,7
F,0.53,0.42,0.135,0.677,0.2565,0.1415,0.21,9
M,0.44,0.365,0.125,0.516,0.2155,0.114,0.155,10
I,0.33,0.255,0.08,0.205,0.0895,0.0395,0.055,7
I,0.425,0.3,0.095,0.3515,0.141,0.0775,0.12,8
F,0.53,0.415,0.15,0.7775,0.237,0.1415,0.33,20
F,0.545,0.425,0.125,0.768,0.294,0.1495,0.26,16
M,0.475,0.37,0.125,0.5095,0.2165,0.1125,0.165,9
F,0.55,0.44,0.15,0.8945,0.3145,0.151,0.32,19
您有 10 个属性行,但您的数据中只有 9 个属性。
此外,在您的数据中,代码是 M、F、I,但您在属性声明中指出它们是男性、女性、婴儿。
我猜你认为你只是将 class 分配给 sex,但 Weka 中的 class 变量自动成为最后一个变量。我在下面为您重新安排了此内容,并确认它会正确加载。
@relation 'abalone'
@attribute length numeric
@attribute diameter numeric
@attribute height numeric
@attribute wholeWeight numeric
@attribute shuckedWeight numeric
@attribute visceraWeight numeric
@attribute shellWeight numeric
@attribute rings numeric
@attribute sex {M,F,I}
@data
0.455,0.365,0.095,0.514,0.2245,0.101,0.15,15,M
0.35,0.265,0.09,0.2255,0.0995,0.0485,0.07,7,M
0.44,0.365,0.125,0.516,0.2155,0.114,0.155,10,M
0.475,0.37,0.125,0.5095,0.2165,0.1125,0.165,9,M
0.53,0.42,0.135,0.677,0.2565,0.1415,0.21,9,F
0.53,0.415,0.15,0.7775,0.237,0.1415,0.33,20,F
0.545,0.425,0.125,0.768,0.294,0.1495,0.26,16,F
0.55,0.44,0.15,0.8945,0.3145,0.151,0.32,19,F
0.33,0.255,0.08,0.205,0.0895,0.0395,0.055,7,I
0.425,0.3,0.095,0.3515,0.141,0.0775,0.12,8,I