R 使用公式接口时出现问题的随机林训练运行时
从以下行运行随机林示例:R 使用公式接口时出现问题的随机林训练运行时,r,performance,machine-learning,formula,R,Performance,Machine Learning,Formula,从以下行运行随机林示例: forest_model <- randomForest(as.factor(male) ~ ., data=train, ntree=10000) forest\u model控制收敛的一个想法是使用do.trace作为详细模式 iris.rf <- randomForest(Species ~ ., data=iris, importance=TRUE, + proximity=TRUE,do.trace
forest_model <- randomForest(as.factor(male) ~ ., data=train, ntree=10000)
forest\u model控制收敛的一个想法是使用do.trace
作为详细模式
iris.rf <- randomForest(Species ~ ., data=iris, importance=TRUE,
+ proximity=TRUE,do.trace=TRUE)
ntree OOB 1 2 3
1: 8.62% 0.00% 9.52% 15.00%
2: 5.49% 0.00% 3.45% 13.79%
3: 5.45% 0.00% 5.41% 11.76%
4: 4.72% 0.00% 4.88% 9.30%
5: 5.11% 0.00% 6.52% 8.89%
6: 5.56% 2.08% 6.25% 8.33%
7: 4.76% 0.00% 6.12% 8.16%
8: 5.41% 0.00% 8.16% 8.16%
.......
iris.rf发现了问题,在randomForest中使用公式造成了巨大的性能下降
有关这一点以及如何估计随机林运行时间的更多信息,请参见:
而且
以下是最终代码:
forest_model <- randomForest(y=train$male, x=train[,-2], ntree=10000,do.trace=T)
forest\u模型谢谢!现在,当我将变量数量从7000减少到3500时,我可以看到创建森林的过程(非常缓慢)。但是对于7000个变量,我仍然没有看到任何输出。有进一步的评测建议吗?您可以使用ntree=100
运行一些示例,然后ntree=500
等等。。。通过变量数量、处理器(如果使用并行)等计算出每台计算机在计算机上花费的时间,然后绘制结果,然后可以推断出ntree=10000
是否为随机林运行时间与树的数量成线性关系?