我正在学习使用 weka 来解决聚类问题。ARFF 文件的使用对我来说似乎是新的。我有一个疑问,我无法从我搜索的内容中在线找到解决方案。问题是从 ARFF 文件访问特定属性。例如,我的文件有这样的内容,
@relation whatever
@attribute Latitude numeric
@attribute Longitude numeric
@attribute NoOfEmp numeric
@attribute Revenue numeric
@attribute Type4 numeric
@attribute Type6 numeric
@attribute Type7 numeric
@attribute Type8 numeric
@attribute Type9 numeric
@attribute Type10 numeric
@attribute Type11 numeric
@data
0.456,0.029,-0.143,-0.143,1,0,0,0,0,0,0
0.443,0.032,-0.286,-0.286,1,0,0,0,0,0,0
0.487,0.012,-0.286,-0.286,1,0,0,0,0,0,0
0.435,0.027,-0.286,-0.286,1,0,0,0,0,0,0
0.467,-0.01,-0.143,-0.143,1,0,0,0,0,0,0
0.484,0.007,-0.286,-0.286,1,0,0,0,0,0,0
0.456,0.029,-0.286,-0.286,1,0,0,0,0,0,0
0.457,0.032,0.286,0.286,0,0,1,0,0,0,0
0.486,-0.019,0.286,0.286,0,0,1,0,0,0,0
并且使用 X-Means 聚类算法,将上面的每一行作为一个实例,也就是说,如果我说给第四个实例,它给出
0.435,0.027,-0.286,-0.286,1,0,0,0,0,0,0
但我需要的是单独获取一个属性,例如从上述实例中获取“-0.286”。我尝试了 instance[2] 但它说“对象不可订阅”。我对此完全陌生,有人可以帮我吗?
任何帮助都会非常有用。
提前致谢。