【发布时间】:2014-10-17 23:45:55
【问题描述】:
我有一个从随机森林生成的模型。在其中,有一个名为 call 的属性,它会告诉我 randomForest 调用的函数。
我想获取这个参数,从模型中删除一列并再次运行它。
例如:
library(randomForest)
data(iris)
iris.rf <- randomForest(Species~.-Sepal.Length, data=iris, prox=TRUE)
iris.rf$call
# want to remove the field Sepal.length as well
# the call should be then
# randomForest(Species~.-Sepal.Length-Sepal.Width, data=iris, prox=TRUE)
我尝试转换为列表,粘贴新参数,然后再次将其添加到 iris.rf[[2]],但它粘贴在公式的所有部分。
我无法摆脱类调用,更改它然后调用 eval() 再次运行它。
【问题讨论】:
标签: r machine-learning call dynamically-generated random-forest