作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
R 包randomForest报告森林中每棵树的均方误差。但是,我需要对数据中的每个案例进行置信度测量。由于randomForest通过对单棵树的预测进行平均来计算逐个案例的预测,我想它也应该可以计算逐个案例的标准误差,从而计算出置信区间。可以使用输出 randomForest 对象来完成此操作(如果是:如何?)还是我必须深入研究源代码?
最佳答案
无需深入研究源代码。您只需要阅读文档即可。 ?predict.randomForest
声明其参数之一称为 predict.all
:
predict.all Should the predictions of all trees be kept?
因此,将其设置为 TRUE
将为每种情况、每棵树保留预测,然后您可以使用它来计算每种情况的标准误差。
我最近得知 this Stefan Wager、Trevor Hastie 和 Brad Efron 发表的论文更严格地研究了随机森林(和其他袋装预测器)生成的预测的标准误差概念。
关于R 中的随机森林 : Is there a possibility of calculating casewise confidence intervals?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14709711/
R 包randomForest报告森林中每棵树的均方误差。但是,我需要对数据中的每个案例进行置信度测量。由于randomForest通过对单棵树的预测进行平均来计算逐个案例的预测,我想它也应该可以计算
我是一名优秀的程序员,十分优秀!