简体   繁体   English

我可以看到 R randomForest 包中回归任务的袋外错误吗?

[英]Can I see the out of bag error for regression tasks in the R randomForest package?

I'm using the randomForest package in R for prediction, and want to plot the out of bag (OOB) errors to see if I have enough trees, and to tune the mtry (number of variables at each split) variable.我正在使用 R 中的 randomForest 包进行预测,并且想要绘制袋外 (OOB) 错误以查看我是否有足够的树,并调整 mtry(每次拆分时的变量数)变量。 The package seems to automatically compute the OOB errors for classification tasks, but doesn't do so for regression tasks.该包似乎会自动计算分类任务的 OOB 错误,但不会为回归任务这样做。 Does anyone know if there is a way to look at the OOB errors for regressions tasks?有谁知道是否有办法查看回归任务的 OOB 错误?

You can also look directly at the out of bag predictions:您还可以直接查看 out of bag 预测:

data(airquality)
set.seed(131)
ozone.rf <- randomForest(Ozone ~ ., data=airquality, mtry=3,
                         importance=TRUE, na.action=na.omit)
ozone.rf$predicted

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM