When we run the code, we need to specify the stopping criteria for arbitrary.
By default, programs set some criteria.
But we need to understand this so that we can control the dryland.
Also, one of the major problems with Rhys's overfitting.
This problem can be avoided if we do not let the tree grow beyond a certain point.
So here I am showing you three methods which we can use to control tree growth.
First is by specifying the minimum number of observations required to split the node.
Suppose we said that we need minimum six observations at a node.
Most splitting.
So if you remember that example, we had 10 student.
We made a split and we got five students in this node and five students in this.
Now, if I had a criteria that minimum number of observations in a. node should be six to consider a
split in this node.
Both of these nodes will not meet the criteria and the regrowth will stop after the first played only.
The next method is specifying the minimum number of observations required at the leaf node.
So when we consider making a split after the split, we can specify how many minimum number of observations
should be present in each node after that split.
So suppose if I said that after a split, there should be at least three observations.
Then when I'm splitting this node and I'm getting three of the revision, then this and only two in
this, this leaf node will not meet the criteria.
Therefore, this split will not be possible.
As leaf node is not meeting the criteria which I am setting, I did leave node.
So this is setting the value of minimum observations in the leaf node.
The third method is.
Giving the maximum depth of the three.
So ar3 started, Zeder, that.
So this Naude is zero.
If I mentioned that I need a tree with a maximum depth of one, it will do one split, which is splitting
on the basis of ours.
And after that, it will stop.
If I mentioned to this is depth zero, this is depth one.
It will again do a split.
This will be depth two.
And after that, it will stop.
So using maximum depth, you get to control the growth of this tree.
So using these three method before you run your decision tree, you can tell that at which step rebuilding
process should stop.