要解决这个问题主要依据计算袋外错误率OOB error(out-of-bag error)。 在构建每棵树时,我们对训练集使用了不同的bootstrap sample(随机且有放回地抽取)。所以对于每棵树而言(假设对于第k棵树),大约有1/3的训练实例没有参与第k棵树的生成,它们称为第k棵树的oob样本。而这样的采样特点就允许我们进行oob估计,...
forest: RandomForestModel, oobError: Double): Array[Double] = { (0untilbins.size).par.map(featureIndex => { val binCount = if (strategy.categoricalFeaturesInfo.contains(featureIndex)) { // category feature strategy.categoricalFeaturesInfo(featureIndex) } else { // continuous feature bins(featu...
forest: RandomForestModel, oobError: Double): Array[Double] = { (0untilbins.size).par.map(featureIndex => { val binCount = if (strategy.categoricalFeaturesInfo.contains(featureIndex)) { // category feature strategy.categoricalFeaturesInfo(featureIndex) } else { // continuous feature bins(featu...