简体   繁体   English

随机森林图像中决策树的数量和总颜色

[英]Number of decision trees in a random forest image and total colors

I am training a random forest model using sklearn RandomForestRegressor for an image.我正在使用 sklearn RandomForestRegressor为图像训练随机森林模型。 I understand that by increasing the depth of the model, the decision tree expands and more colors can be included.我知道通过增加模型的深度,决策树会扩展并且可以包含更多颜色。

I don't understand though how increasing the number of trees within the model effects the number of color patches.我不明白增加模型中树的数量如何影响色块的数量。 My impression is that the number of trees is used to average out over the values and eliminate bias - so I was under the impression that the divisions of boxes might change but the overall number of colors would remain constant (since you still have the same number of decisions made).我的印象是树的数量用于对值进行平均并消除偏差 - 所以我的印象是盒子的划分可能会改变但颜色的总数将保持不变(因为你仍然有相同的数字做出的决定)。 Upon running the model for trees of [1, 3, 5, 10, 100], I do see that the model with 100 trees does have more patches of color through shading of the boxes.在运行 [1, 3, 5, 10, 100] 树的模型时,我确实看到有 100 棵树的模型通过框的阴影确实有更多的颜色块。

Would someone explain to me why does increasing the number of trees seems to be increasing the number of color patches?有人会向我解释为什么增加树的数量似乎增加了色块的数量?

随着树木数量的增加,深度 4 随机森林中的颜色阴影

It doesn't increase the number of color patches.它不会增加色块的数量。

Imagine if you only had two color patches, black and white, but 50 trees in your forest.想象一下,如果您的森林中只有两个色块,黑色和白色,但有 50 棵树。 What color would you give a point if 25/50 trees predict black, and the others white?如果 25/50 的树预测黑色,而其他树预测为白色,您会给出什么颜色的分数? You could simply output either black or white, but you could also output gray as a more accurate visualization.您可以简单地输出黑色或白色,但也可以输出灰色作为更准确的可视化效果。

That's what your visualization is doing, the primary colors stay the same but they can blend if different trees in the ensemble predict differently.这就是您的可视化正在做的事情,原色保持不变,但如果集成中不同的树预测不同,它们可以混合。

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

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