Now we're going to discuss the second technique of ensemble method, which is called Random Forest.
Random forest provides an improvement or bag trees.
By way of DeCota letting the trees.
Let me explain what this problem of Correlated Prizzi's.
Remember when we did bagging?
We created multiple data sets and made multiple trees on them using all our predictive edibles.
Suppose that there is one strong predictor.
Indeed, he does it along with a number of other moderately strong predictors.
Then in the collection of bag trees, most or all of the trees will use this strong predictor in the
conflict.
Consequently, all of the batteries will look quite similar to each other.
And the prediction of bad trees will be highly correlated.
And when the quantities are correlated, everything them does not lead to any large reduction in.
So due to the problem of correlated outcomes of bagged trees.
Bagging does not result in significant reduction in radians.
The solution to this problem is building a random forest.
The concept is that we want a group of trees.
And these trees should be different so that we get non correlated outcomes.
So instead of using all the variables, we use a subset of the predictive renewables for each tree.
Therefore, a lot of these players will not even consider these strong predictors.
So here you can see the process.
It is exactly similar to the begging process.
Only one step is added.
The step is selection of MDD and unpredictable variables out of P, these m randomly big variables will
only be used to create that model.
So suppose if we had 15 predictive variables, we will select randomly five of the predictive intervals
to create model one randomly.
Another set of five variables to create model two and so on.
You can see that if we select all the variables here, this becomes bagging.
That is, if M is equal to P.
This is exactly same as bagging.
So we can see that bagging is a special case of random forest in which we use all the predictive variables
to make this place.
And Belltrees.
The last point I want to discuss is how many predictive variables should we choose to create these trees?
Usually this number is depicted by M as a general rule of thumb, you can use M is equal to be by three.
In case of regression.
Will be is detailed a number of critical variables in your dataset.
And M is equal to under Ruby for classification.
So if you have suppose 16 variables for regulation, you should be using M is equal to nearly five and
four classification squared.
Square root 16 will come out to be four.
So you should use M is equal to four.
However, if the predictor variables in your dataset are highly correlated.
In such a scenario, you should use even smaller venues of M..
So that's all the theory you need to know.
Now we can run random forest in our software package and let us see its performance against normal tree
and a Bagdadi.