生成树时没有用到的样本点所对应的类别可由生成的树估计,与其真实类别比较即可得到袋外预测(out-of-bag,OOB)误差,即OOB estimate of error rate,可用于反映分类器的错误率。此处为为1.19%,显示分类器模型的精准度是很高的,可以有效识别两类分组。Confusion matrix比较了预测分类与真实分类的情况,class.err...
注意err.rate结果的释义是:(classifification only) vector error rates of the prediction on the input data, the i-thelement being the (OOB) error rate for all trees up to the i-th.即表中的数据是累积结果,如n=410时OOB误差率=0.346,其意为生成411棵树的随机森林模型的OOB误差率是34.62%。我们可...
OOB estimate of error rate: 7.22% Confusion matrix: setosa versicolorvirginicaclass.error setosa 31 0 0 0.00000000 versicolor 0 32 3 0.08571429 virginica 0 4 27 0.12903226 从上面对模型的解释中,我们可以看到该模型的oob error为7.22%,下面的矩阵表明第二类和第三类存在误判。 # 绘制每一棵树的误判率 >...
randomForest()函数从训练集中有放回地随机抽取84个观测点,在每棵树的每个节点随机抽取36个变量,从而生成了500棵经典决策树。 生成树时没有用到的样本点所对应的类别可由生成的树估计,与其真实类别比较即可得到袋外预测(out-of-bag,OOB)误差,即OOB estimate of error ra...
(formula = Event ~ ., data = trainData, importance = TRUE, ntree = 500)# Type of random forest: classification# Number of trees: 500# No. of variables tried at each split: 6## OOB estimate oferrorrate: 22.4%# Confusion...
生成树时没有用到的样本点所对应的类别可由生成的树估计,与其真实类别比较即可得到袋外预测(out-of-bag,OOB)误差,即OOB estimate of error rate,可用于反映分类器的错误率。此处为为1.19%,显示分类器模型的精准度是很高的,可以有效识别两类分组。 Confusion matrix比较了预测分类与真实分类的情况,class.error代表...
Number of trees: 100No. of variables tried at each split: 3 OOB estimate of error rate: 5.41% Confusion matrix: setosa versicolor virginica class.error setosa 39 0 0 0.00000000 versicolor 0 33 3 0.08333333 virginica 0 3 33 0.08333333 MDSplot():函数用于实现随机森林的可视化 specialmds <- cmds...
OOB estimate of error rate: 使用袋外数据(OOB)估计的错误率。 Confusion matrix: 混淆矩阵(仅适用于分类任务)。 4. 分析模型的性能指标 对于分类任务,我们可以使用准确率、召回率等指标来评估模型的性能。然而,随机森林模型通常通过OOB错误率和混淆矩阵来评估。此外,我们还可以使用importance函数来查看变量的重要性...
## No. of variables tried at each split: 5 ## ## OOB estimate of error rate: 4.77% ## Confusion matrix: ## B M class.error ## B 244 6 0.02400000 ## M 13 135 0.08783784 plot(rf.biop) 1. 2. 3. 4. 5. 6. 7. 8.
OOB estimate of error rate: 4.44% Confusion matrix: setosa versicolor virginica class.error setosa 32 0 0 0.00000000 versicolor 0 29 2 0.06451613 virginica 0 2 25 0.07407407 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. ...