In this session, we will discuss about the forced ensemble learning method, which is bigging, which
has been implemented in the form of random forest.
So let us look at it.
So first of all, let us discuss about the session, please, so large decision trees have low bias
and high variance and they tend to overthink.
While in case of storms, the storms have high bias and low ratings and depend on the.
Now, these will be creating all random forest, random forest is an implementation of bagging and bagging
helps us to reduce the variance.
So how do we do that is we basically combine different stumps and we take the average of them so that
we get the low variance model.
So let's see for the what are we doing in case of body?
In case of bug, we reduce the variance.
So we combine the stumps so that the audience is reduced in comparison to the degree.
So in case of decision tree, we have high variance.
So what we do is we basically use stumps so that we could have low variance in this particular situation.
So how what is actually random forest?
So we have discussed about bigging, we have discussed about why they use the stumps instead of decision
trees, but we don't really know what random forest is.
So random forest is a group of small decision trees, that is a group of stumps which we think and using
these group of stumps, we create a huge forest, we create a forest.
What is a forest?
Forest is something that contains a lot of trees.
So same thing is here we are creating forest of decision stumps.
Now, when we are creating the forest of decision brown stumps, we need to add this randomness.
So when we are seeing random forest, it means that we are creating a forest and we have to add some
randomness to it.
Now, how are we introducing this randomness, this randomness has been introduced by creating subsect
of samples, which is taken for the framing of each and every three.
So when you will be creating that decision, what we do is we invite the decision three, we consider
all the features which are present now in case of random forest, when we will be creating the decision
stems, we will be taking the small samples of data instead of considering all the samples of data.
So we will take only small samples of data so that we can get only a subset of the data points.
That is only a subset of patterns from the data.
The next thing what we do is we also take a subset of the variables by draining each tree.
Now, what happens when we are taking the subset of variable now?
Because we are taking a subset of variables.
So instead of having all the features present for creating a tree, we are now having different subsets
of features for creating that decision.
Now, imagine if we would have used the complete set of features for creating the decision tree stumps.
Then what would have happened is that because it will be evaluating all the root?
And because it is evaluating all the rules on the basis of same Ghneim, they sort of squared errors.
That is the reason why it will be the next thing, the rules which are having the highest Guiney gain.
So that is the reason why it was the same split in the first and then followed by the next split.
So the decision tree, which will be formulated will be just the same because there is no new feature
or no subset of feature, which is why when the new features will not be there, when the old features
will not be accepted, then it will be creating exactly the same decision because there is no variation
in it.
So that is why we need to provide the variation in the form of randomness.
Which is the reason why we are looking at a sample subsid so from the entire data, we will look at
small samples of the data at every time.
And for creating the rules, we will be creating all the rules from all the variables.
We will not be considering all the variables for creating the three.
We will be creating only rules from the small subset of the variables.
Now, again, for each and every split which we will be creating, the rules are not considered from
the all in variables.
So let us see.
Initially, we have a number of variables from which we use to create our decision.
Three these rules.
But all the variables which we had.
So now for creating the stump one stump to stump three and four, I will be taking small subsets of
these variables.
So now the subsequent have any number of variables.
So each more they created from any number of variables.
I like creating the subsect while creating this small stump out of these and variables out of these
variables.
Each split, which I will be making now, the rules will be big.
No, from these in variables, but again, a subset of these in variables.
So you see.
The four subsegments we are taking is like creating the tree itself by creating the stump itself or
the Vitullo itself, so the vehicle itself could be created from a subset of the original number of
features which we had from these variables, which we now have the smaller subset of people, which
we now have from this also every split which we will be making at every split.
Again, we will not consider all the rules, but only a subset of these rules.
So this will again be the one the miss in the stump or in the vehicle, which we will be using now as
a random subset of features selected for the --, are different for each and every split.
So this is what we have known for now.
So that is that the subset of the samples will be done.
Then the subset of the variables will be considered for creating the pre and after creating these three
from this subset.
And every split, again, we will be considering a subset of the number of variables which we have now.
So this is how we will be adding randomness to the decision to.
Now, what a different type of enemy does we have for them?
What is the hypovolemic those?
The investigators, what are the investigators these are in these numbers, which is the which is the
number of bodies which we will be creating so we can create the one hundred three point five hundred
these thousand trees, any number of trees.
But the prescribed number is five hundred five hundred usually works.
Well, in the case of random forest, we usually try a hundred five hundred thousand and then narrow
it down for the.
Next is maximum depth, maximum bet is again in these informal eye, this shows the maximum depth of
the model or the vehicle on which we will be using.
So each week, lonas, that is the maximum that usually we keep it around to five.
Then we have Mike Sumfest.
This is the number of samples to draw from the X Supreme E to base estimated that this.
This maximum number of samples, so what is the maximum number of samples which we have to select?
For creating the estimated then minimum impurity degrees, that is an order will be split if this split
induces or degrees of the impurity greater than the equal of this value that this.
That is the minimum amount of impurity or degrees, or you can also see information gain the information
gained, which we were talking about, we said that if we have a fixed amount of information gain at
least a minimum amount of information gained, then only we will make a split.
Otherwise we will not make a split.
Then warm, stop it, if it is said to be true, then it will allow us to refuse the solution of the
previous goal of the Fichte function and it will allow us to add more estimated dollars to the ensemble.
Otherwise it will just fit a whole new forest.
Then in the jobs is what defines the number of jobs which begin the running buddy.
So instead of creating the number of threes sequentially, we can actually create them.
Barlinnie by using any jobs.
So this is the theory about random forest.
Next, we will learn about the implementation of random forest.
Now, at this point of time, you have a good knowledge of how a model should be generated.
So now you can actually start to create your project.
So to create your project, you can become the B2C provider and to the data set, you can now actually
run the NINIAN models and often linear models.
You can start implementing decision tree, random forest.
And as we go ahead, you will be implementing stocking and extra boost to it and finally create a pipeline
of the best models which you have generated.
This is a project which will allow you to try all the aspect of machine learning.
That is from data preparation to data analysis and also the implementation of various machine learning
algorithms.
And it will allow you.
To compare different machine learning algorithms with each other so that you can easily create the models
when you want to create them in the real life during your walk.