# What does "node size" refer to in the Random Forest?

What is meant by node size in a Random Forest model? I understand what a decision node is, but not what is meant by node size.

A decision tree works by recursive partition of the training set. Every node $$t$$ of a decision tree is associated with a set of $$n_t$$ data points from the training set:

You might find the parameter nodesize in some random forests packages, e.g. R: This is the minimum node size, in the example above the minimum node size is 10. The minimum node size is a single value: e.g. 10.

If splitting a node generates two nodes for which one is smaller than nodesize then the node is not split, and it becomes a leaf node.

It is actually a stopping criterion. This parameter implicitly sets the depth of your trees.

Setting this number to bigger values causes smaller trees to be grown (and thus take less time). Note that the default values are different for classification (default 1 in R) and regression (default 5 in R).

In other packages you directly find the parameter depth, e.g. WEKA:

-depth from WEKA random forest package

The maximum depth of the trees, 0 for unlimited. (default 0)

• What are 'records'? Do you mean data points? Why is each node associated with a set of records? I understand random forests quite well, but I do not know what the jargon means. Commented Jun 25, 2015 at 7:08
• Yes, I meant data point. Usually you might refer to data points as records, instances, or examples. Commented Jun 25, 2015 at 8:13
• In random forests, trees are fully grown: node size is 1. Overfitting is avoided growing many trees. In decision tree it is more tricky. Trees are not fully grown and you have to perform pruning to avoid overfitting. Commented Sep 20, 2017 at 9:57
• It looks like winnowing is some sort of feature selection to simplify the tree and avoid overfitting. I guess pruning a single tree is always beneficial. Instead, winnowing can sometimes decrease the accuracy but it simplifies the tree. Commented Oct 2, 2017 at 14:50
• I understand. But maybe you could add this to the answer above? I find it not clear in its current state. Commented Apr 17, 2023 at 9:45

It is not clear if the nodesize is on the "in-bag" sampling or on the "out-of-bag" error. If it is on the "out-of-bag" sampling, it is slightly more restrictive.