随机森林 OOB理解

一个大小为N的数据集D.

1.有一个问题是, 对于随机森林的每一棵CART树是怎么训练的, 如何划分训练集测试集?

Bootstrap, 对数据集随机有放回抽样N次作为一棵CART树的训练集.

根据概率论,可知数据集中有大约1/3的数据是没有被选取的(称为Out of bag),所以就是这没被选取的部分作为小树的测试集.



2. 接下来的问题是, 怎么测试随机森林的性能, 测试集是什么?

这里其实理解的有偏差: 随机森林有一个重要的优点就是,没有必要对它进行交叉验证或者用一个独立的测试集来获得误差的一个无偏估计。它可以在内部进行评估,也就是说在生成的过程中就可以对误差建立一个无偏估计。

实际上, 数据集D中的每一个样本都可以拿来做测试数据, 对于一个样本d, 森林中大约有1/e树是OOB的, 那么这1/e的树就构成了预测样本d的森林,用简单投票法计算分类结果. 从而得到总的error.


(Put each case left out in the construction of the kth tree down the kth tree to get a classification. In this way, a test set classification is obtained for each case in about one-third of the trees. At the end of the run, take j to be the class that got most of the votes every time case n was oob. The proportion of times that j is not equal to the true class of n averaged over all cases is the oob error estimate. This has proven to be unbiased in many tests.)原文



猜你喜欢

转载自blog.csdn.net/nemoyy/article/details/80317936