2014-02-21 83 views
0

我學習使用weka進行聚類問題。 ARFF文件的使用對我來說似乎是新的。我懷疑我從哪裏找不到解決方案。問題是從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均值聚類算法,在上述各線的被作爲一個實例,即,如果我說給第四個實例,它給

0.435,0.027,-0.286,-0.286,1,0,0,0,0,0,0 

但我需要的是單獨獲取一個屬性,從上述實例中說「-0.286」。我嘗試了實例[2],但它說「對象是不可編程的」。我完全陌生,任何人都可以幫助我嗎?

任何幫助將是非常有用的。

在此先感謝。

回答

0

我已經得到了答案。它的"data.instance(2).value(3)"