Hello and welcome back to the course on Machine Learning.
Today we're talking about random forests.
Let's have a look inside.
So first thing we're going to learn is a new concept.
Ensemble learning. What is ensemble learning.
Ensemble learning is when you take multiple machine learning algorithms
and put them together to create one bigger machine learning algorithm.
So that machine learning algorithm, the final one is actually using
a leveraging many different other machine learning algorithms.
And they can be the same machine learning algorithm as we will see today.
We're going to be looking at the random
forest method which combines lots of decision tree methods.
So instead of running a decision tree method, which we talked about earlier,
instead of running it once, we're going to run it multiple times.
And that will give us a random forest.
So let's have a look at the step by step process to understand
how all of this happens.
So step one is you pick at random k data points from the training set.
Then you build a decision tree associated to those k data points.
So instead of building a decision tree
based on everything you have in your data set,
you build a decision tree just based on some of the data points that you have.
So kind of like a subset of all of your data set.
Next, you choose the number of trees you want to build, and you repeat steps
one and two.
And then once you have all of those trees and you have a new data point.
So when you want to check where and you thought about falls
or how is classified for a new data point, you make each one of your entry trees
predict the category of which the data point belongs to, and then you assign
the new data point to the category that wins the majority vote.
So that's how a random forest works.
So basically you start off with one tree and then you build another tree,
another tree, another tree.
And each one of those trees
is being built on a randomly selected subset from your data.
And even though each one of those trees might not be ideal
overall, on average they can perform very well.
And that's a major advantage of this algorithm.
It's kind of leveraging the power of the crowd, so to speak,
instead of just relying on one tree.
It's checking what all the trees are going to say,
and then just taking the majority vote and deciding the classification
based on that and that power of numbers can help get rid of certain errors and
certain uncertainties in your algorithm and make it more precise.
And in fact, it's such a good solution that when Microsoft were developing
Kinect, you know, this device that allows you to play games on your television,
that little device over there, it attaches to Xbox,
and then you can play games without any controller.
So here that device is using an infrared grid
to understand where the hands, arms, heads
and other parts of the body of these people are located and how they're moving.
And it's using machine learning to understand how
the body parts are moving and where exactly they're located in space.
So when Microsoft was developing Kinect, they decided to go with the Random Forest
algorithm over all of the other machine learning algorithms
that were available to them, and use the random forest to develop
this sophisticated piece of hardware.
Software.
And actually, they have a interesting article about it.
So I'm just going to show it to you.
Now with you, you can find on the internet.
So it's at microsoft.com.
This is from there.
And you can definitely find it there.
It's called real time human pose recognition parts
from single depth images.
And here it explains exactly.
So you can actually see the random forest in action.
So you can see that
this is similar to what we were talking about before in the classification trees.
But here it's actually using random forests
to understand where body parts are.
And then based on that the device
finds, what it needs to do in that computer game.
So that's how it works.
And so here,
if I just search for the word forest, you'll see that, decision forest.
Decision forest. The decision forest.
And they actually explained that, they were able to achieve faster speeds,
faster processing with the decision forest and therefore that, you know,
reduced the cost of the hardware that they required for this tool.
interesting article.
check it out.
If you want to learn a bit more about a real life practical application
of a decision forest or a random forest.
And that's it for today's tutorial.
I hope you enjoyed learning a bit about an ensemble type of machine
learning algorithm.
Definitely the practical side is going to be quite interesting as well,
and I look forward to seeing you next time.
Until then, enjoy machine learning.