Hello, I am going to present very briefly how the algorithm random forest works
Well, we start with a rationale of the term and we say that the combination of learning
models increases the classification accuracy
When we use different learning models we can increase the accuracy of classification, which
is the main idea of a technique that is called bagging
And bagging, the main idea is to average noisy and unbiased models in order to create another
model with a lower variance, in terms of classification Now, we describe the random forest, a very
brief definition Random forest algorithm works as a large collection
of the correlated decision trees Well, the name forest is because we use a
lot of decision trees But this algorithm of random forest creates
a lot of decision trees and use them to make a classification
That is why it is a technique based on the bagging technique, that we presented before
So, how the random forest algorithm works? Lets see
We show here in this example a matrix S Suppose this matrix S is a matrix of training
samples that we will submit to the algorithm to create a classification model
In this case f A 1, f B 1, f C 1, these are a lot of features, for example the f A 1 is
the feature A of the first sample And we continue in all the samples up to N
So, the f B N is the feature B of the Nth sample
And also we have in the last column here the C 1 and C N, which means that we have lots
of features and we have a training class So the aim is to create a random forest to
classify this sample set How the algorithm works, in detail?
Well, we get this sample set and from this sample set we create a lot of subsets with
random values Which means that, for example, in the first
subset we used the line number 12, the line number 15 and also the line number 35
And also some other random elements here So we get a subset from that previously shown
sample set and from this element we create a decision tree number 1
Then we make another random subset with different values, we can see that we have the sample
number 2, sample number 6 and the sample number 20 and many others
With these values we can create a decision tree number 2
And from this M sample we can create the decision tree number M
So, this is why we call it a forest Because we have a lot of decision trees
And after we created all of these decision trees
I am going to repeat that used different samples from each of the sample set here, we created
a subset with random samples Then with all these decision trees we have
different variations of the main classification Then we are going to use all of this decision
trees to create a ranking of classifiers So, in the next example here we show how we
can make the class prediction I showed 4 examples of decision trees here
only to see how the class prediction will work
In this case we have 4 decision trees, our forest is composed by 4 trees
If we have a new element to classify we are going to ask for the first tree what is the
prediction Suppose the first tree said that the classification
of this sample is class 1, and then we called to the second decision tree and it says that
is class number 3 and then the other says that it is class number 1 and the other says
is class number 2 So we have 4 decision trees, independent decision
trees here which were created using subsamples of the entire sample set
And now we can account for the number of votes for each class
It is obvious that we have 1 vote here and another vote here for class 1, so we have
2 votes for class 1 and a single vote for class 2 and a single vote for class 3
So the result is going to be class 1 This random forest classified all the elements
and the class 1 was the selected class of this classification
So it is a very simple process, the difficult here is to create a lot of decision trees
but the creation of decision tree belongs to the algorithm of decision trees
So, this is the idea behind the random forest algorithm
Here I provide some references The main reference is this one, Random Forests,
which was published in 2001 And also I used this book to create this presentation
So this is how Random Forest algorithm works