1、随机森林对变量类型有什么要求吗
随机森林的好处就是简单,粗暴。 对变量原则上没要求。不需要做one-hot编码,不需要做归一化。(归一化做了,还是有效果的。)
2、怎么选择最佳ntree和mtry
randomForest - For classification models, the default is the square root of the number of predictor variables (rounded down). For regression models, it is the number of predictor variables divided by 3 (rounded down).
mtry,基本默认值就是最佳的。
ntree 可以适度增加,从500涨 到1000. 一般来说,会增加准确度。条件是数据足够多,你的机器足够好。随机森林是很耗资源的。
随机森林主要是通过 importance 做feature selection, 适度去掉一些无用的维度。看看是否能提高预测境地。


雷达卡




京公网安备 11010802022788号







