2014-01-14 75 views

回答

5

你不能子集這個對象,所以從某種意義上說,x[[9]]就是沒有什麼,它是不可訪問的。

x是S4類"RandomForest-class"的一個對象。該課程記錄在幫助頁面?'RandomForest-class'上。這個對象的插槽在那裏被命名和描述。您也可以通過slotNames()

library("party") 
foo <- cforest(ME ~ ., data = mammoexp, control = cforest_unbiased(ntree = 50)) 

> slotNames(foo) 
[1] "ensemble"   "where"    "weights"    
[4] "initweights"   "data"    "responses"   
[7] "cond_distr_response" "predict_response" "prediction_weights" 
[10] "get_where"   "update" 

得到插槽名稱如果x[[9]]你的意思是第九插槽,然後就是predict_weights?'RandomForest-class'告訴我們,這是

‘prediction_weights’: a function for extracting weights from 
     terminal nodes.