Hello, also in the session, we are going to learn what exactly is random forest and what use cases,
what type of use cases, you can basically use this machine learning algorithm.
So random forest is that type of algorithm which is used in case of classification as well as in case
of classification as well as in case of regression as well.
So you might have heard that random forest is a classification algorithm.
Yeah, most of the cases it is used in classification, but it is not correct that it is a classification
algorithm because inside could learn, which is a machine learning library, which is especially big
for modeling purposes.
In this cyclone, you have something known as random forest degressive class that is responsible for
performing the Deanwood, or I guess it would deal with some type of regression use case.
And we have a class known as random forest classifier, which is exactly for classification use cases.
So what exactly is this random forest?
So random forest is nothing.
It is.
It just follows it just follows my example learning approach.
Random forest just follows in Sambell Learning approach.
So what is this in Sambell Learning Approach?
So Istanbul Learning Airport is all about basically it learns from multiple models, it learns from
multiple models, and at the end it will combine all the learning and add that it will combine all the
learning.
That was my Istanbul approach will do.
And Random Forest basically follows this type of approach.
And random forest is nothing.
It is just a classification.
It is just a collection of multiple decision trees.
So before understanding this random forest, you have to understand what exactly is this decision?
Trees, how you can build decision trees.
What are the parameters on which using what?
What are the parameters using that you can build your decision trees.
You have to understand that.
So let me open a new bit.
And here I'm going to give you a quick overview.
What is this is and trees and how you can build it.
What is the background of this country's what are the parameters that you are going to play with once
you try to build the trees?
So what exactly is decision tree?
What is this isn't.
So this season tree basically it's.
And then machine learning algorithm.
For classification use cases as well as for regression use case as well.
So this is that algorithm that is highly used in classification as well as in regression use case.
So it is basically this decision tree.
It is basically a base algorithm.
I can see it is basically a base algorithm which is used in every conceivable technique, let's say,
in case of random forest, in case of active use.
So these are all those algorithms.
These are all those algorithm that follows in Zambia learning.
And in this in all this type of algorithm, basically my decision tree is heavily used because it is
a base algorithm that is used in in Sambell Learning.
So what exactly is this?
This is and what is this is entry.
So it is basically like a rule-based kind of thing, let's say, according to condition, according
to condition, how you have to proceed.
So that's it.
That's all about why this is entry.
So it is basically that type of algorithm where it will try to decide what I can say.
It will try to take some decision or it will try to divide the data.
Let's say.
Let me consider a very basic example over here.
Let me open a new page.
Yeah.
Let's see if you have to go for a party that would consider example.
Consider.
Let's say if you have to go for a party, then you have to do some season.
So what can we make this season?
Let's say I'm going to put a very basic condition.
Let's see if.
Time is, let's say, greater than 10 p.m. So in such case, I have to put a condition.
So what if time is not between 10 p.m. and what if time is better than 10 p.m.?
So in such case, if I'm going to say yes, it is, yes.
So here I'm going to say I'm not going.
So basically don't do.
And if it is not, then I have another condition.
Let's see.
Do we have money?
Do we have sufficient money?
I can see.
So then we have a skin condition.
So if yes, if we if we have sufficient money, then definitely go go and enjoy.
Similarly, I have another condition, what if I don't have to be sure the money, so in such case,
I can also download?
So in such case, I can also don't go for the major thing that we will notice over here is we are trying
to divide data.
We are basically tracked by data on the basis of two factors.
The very first one is exactly this time, the second one on the basis of money.
So let me let me down here.
Let me go down here.
So basically on the basis of time and on the basis of money.
Basically, I have to take some decision.
Whether yes or no.
Whether years or so, let's say I'm going to put some random entries over here, let's see what if my
time is 12?
What if my time is 10?
What is this nine?
What is it?
What if I have money?
Yeah, what if I have money?
What if I don't have money?
What if.
Yeah, I have money.
So if I have this condition.
If I have this condition here, basically here my decision will be no, because here you will see it
is greater than 10.
Similarly over here.
I have no similar law here.
I have no money over here.
My decision will be yours because over here my time is less than ten as well as I have money as such.
Excuse my decision would be yes.
So you will see if I have to interpret this.
I can see whenever my time is at 2:00 and I have money for an hour of my time is 8:00.
It means I have to come in this brand and I have money that I have to come in this one.
So it means I can go I can go for a party and enjoy.
So basically what we are going to do in this.
So basically we can have multiple features.
In this case.
We have this two features on the basis of the decision tree.
I have basically two features.
And on the basis of these two features, I have to take some decisions.
Let's see what if we have a more number of features?
So let me open a new bridge.
What if we have a more number of features?
Let's say let's say 50 or 100 Alexi's 60 odd thousand.
Any number of features let's we have.
So in such case, we have to draw a high radical tree like this one.
So this is my bet.
And that's if you will come over here, here, my parent node, you will see here, my parents node
is time and this data node is exactly money.
And this is my leave node where I have with this season.
So similarly, you were here last year.
This is my parents node.
So this is exactly will be my parents node and these are exactly the same.
This is my granddaughter, which is my data and what I can see.
So these are all tunnels that contain some kind of information that contains some kind of data that's
in some level.
Over here, I can have this one.
I can't have this one.
I can have this one here.
I have this one condition here.
I have this one to condition.
So let's get these all out of my life.
No.
So what what we will do, it will be like a hierarchy, this it will be hierarchically like this.
So on the basis of some, on the basis on some condition, I have to basically do some decision.
That's what my decision tree will do in this country.
Whatever pattern we will learn from our training data, whatever pattern we will learn from our training
data on which our.
Relationship is going to establish basically what craniotomies on which our relationship is going to
establish.
So whatever we are going to learn from data, the similar pattern, the similar pattern, or I can see
the similar hierarchy we are going to follow for our test data, the similar hierarchy we are going
to follow for our prediction data.
So let's say in a previous use case, which is exactly this one, let's say you have to do prediction
for what if my time will be nine o'clock and what if I don't have sufficient?
Next, you have to do prediction for this one.
Let's say this is my unseen neglected this is my testing data.
And in this case, this is exactly my training data.
This is exactly my training data.
So on the basis of this, Janita, you have this disease and you have this disease and this is entered
DNG and basically by a lot of Volumnia, you have to do some kind of prediction.
So basically, let's say you have to do prediction for this data.
Let's say this data.
So what we have what we have time as less than 10 p.m. it means I will come in this loop and now I'm
going to say I don't have sufficient money to go for party.
So after it, I will come I will come over here to here.
My decision is I don't have to go.
So my decision is exactly.
I don't have to go.
Let me open a new page.
Let me this, this, this, this one.
Yeah, you will see, this is my data.
Let's say let's say I have this data.
So let's say I have to create a hierarchy of this data or I can say I have to build such a tree so that
in future, whenever I have some data so that I can do some kind of prediction.
So let's say I have to be I have to build such a tree for this.
So but a major factor over here is what feature I have to select as my parents or whether I have to
select this time feature as my parents.
And rest of all will be my subsequent node.
And let's see whether money will be my node and let's say all other features will be my subsequent note.
So how I have to select the question is that whether I have to select time as my parent or whether I
have to select this money as my parent.
So this is a major concern in this is a..
This is a major concern in this country at the time of selecting better.
Know how you have to select to parenthood.
This is a major concern.
So basically, we have to approach for this to select our parent or to build, because once we have
a better node, we can easily build our decision.
Let's say, what if we have, let's say, ten teachers?
So once we have our parent, no, let's say once we have our parent node, then let's say we have another
condition or another condition or whatever.
Then the similar problem statement, the same problem statement I can again solve using again soil using
X it how I have this better node.
So let's say I have ten features over here.
Let's say I have ten features already, assuming I have ten features over here.
So basically using the concept of entropy, I will discuss later.
I will give you a quick overview of this.
So basically using concept of entropy and information gain, you can easily find out which can be better.
No.
So let's say who that will feature will have highest information.
Gain can be my or I can see will be my Baranov.
Let's say in this case, I have this time as the highest information gain.
So I will do a better node.
Let's see if I have multiple features over here.
I have another feature as let's have three.
So this following statement gets split it into this money and have three.
Similarly, over here, I have some other attribute as well.
So you will see again, you have this kind of column, Stutman, that you can solve using concept of
entropy and information gain.
Then again, you have some kind of tree and at the end you will be up having some kind of decision tree.
So that's what my entropy and information gain look for.
Let me open a new bed.
So there are basically two approaches.
There are basically two approaches.
The very first one is exactly using concept of entropy and information gain.
So using.
This Entropia information gain, you will end up building some disease and similarly using my Guiney
index, or you can also come as guinea impurity.
So using this in Guinea impurity, you can also build up having some kind of vigilante because maybe
there are some algorithm that uses as a genuine death or as a guinea index as the criterion to build
these entries, whereas there are some algorithm that uses and probably.
So it's all up to it's all up to you what exactly you want to use.
So what exactly is this entropy information gain and all this stuff?
So I'm going to give you a quick overview, because if I to start all these things, it will almost
take out of classes to explain all this stuff.
So what exactly is this information gain and all this kind of thing?
So it is all about how random really does what is the probability of having randomness in your data?
So basically what entropy will do, it will basically gives impurity present inside of our data and
using a very basic formula with using a very basic formula, which is exactly this minus of B.I and
log two of log two of by using this formula, using this formula, you can easily compute, you can
easily compute the probability, you can easily compute the entropy of a particular feature where I
is exactly the number of classes in that particular feature.
So once you have entropy, once you have entropy, you have to compute information.
So what exactly is this information gain.
So information gain what exactly.
It's basically based upon basically based upon entropy, based upon entropy feature.
Which one is going to get our highest gain and let's say among Avron f2 f3 feature, if acto feature
as the highest information gain, then we will select this feature as a parent node.
So at the end, any future, whosever future has a high information gain, then that future will be
selected as our paranoid.
So what exactly is a basic formula behind this?
So it is nothing but whatever entropy you have computed for a particular feature.
What do you have to do now?
It is basically one minus summation of S and of as in two E I will s and we add this as equals to total
data point in that particular feature and then exactly out of total data points.
How many we have all how many.
We have data points in order.
Let's say we have three classes in feature one that say we have three classes, let's zero one two in
each other.
So how many data points we have with respect to zero, how many with respect to one and how many with
respect to do.
That's what this will do.
Similarly, what is this e e is nothing but what is the entropy of the zero?
Similarly, in case of what is the entropy of one after it, I have to do just summation of this and
it will give us it will return us some value.
So let's say future two has highest information.
So feature two will be my paranoid and let's say future one will become exactly like this.
And now you have some kind of decision, so similarly, who's our future, who's our future has our
highest information again, that that particular feature, will we get selected as a panel?
That's what my information will do.
And I have another factor, which is exactly Guiney building and using this fact that we can also build
a precedent.
So it's all up to you what you want to use, whether you have to come across with entropy or whether
you have to come across to get the index.
So what exactly is going you know, like we write down a very basic formula that it is exactly yours
inside one building this this is entry.
So it basically used one minus sigma of one.
I goes to one to see where exactly number of classes in any feature, let's say in this feature one
you have three classes, let's say zero one two.
So here it is, nothing but B of I of squared.
So what it will do basically it will basically do a summation of all these things.
It will do summation or basically for B zero.
What is the probability of this one or the probability of having one class for the burden of having
two class and whatever the index will become?
So who's your teacher?
Who's or our future has the lowest Guiney index?
Whosoever future has that lowest guinea index that will get selected as a betting board.
So that's all about the session.
Hopefully will love the session very much.
How exactly I have summarized all these.
This is a result of thinking the easiest to the.
So basically in the next session I'm going to give you how exactly random forest works, how exactly
it uses this is entry's inside and how random forest is able to do predictions on whether it's a regression
case or whether it's a classification.
So I hope you will love this session very much.
Thank you.
How nice to keep learning.
Keep growing, keep practicing.