【发布时间】:2014-01-14 02:46:42
【问题描述】:
如果x是R中的随机森林,例如,
x <- cforest (y~ a+b+c, data = football),
x[[9]] 是什么意思?
【问题讨论】:
标签: r tree random-forest
如果x是R中的随机森林,例如,
x <- cforest (y~ a+b+c, data = football),
x[[9]] 是什么意思?
【问题讨论】:
标签: r tree random-forest
你不能对这个对象进行子集化,所以在某种意义上,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]] 指的是第 9 个插槽,那么这是 predict_weights 和 ?'RandomForest-class' 告诉我们这是
‘prediction_weights’: a function for extracting weights from
terminal nodes.
【讨论】: