简体   繁体   中英

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. 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.

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. What color would you give a point if 25/50 trees predict black, and the others white? 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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