Let's see what prediction we get.
Remember that this employee said that its previous salary was 160 K.
And now let's see what is a random forest composed of ten trees?
So let's execute that.
And it says that the previous salary was $141,000.
That's actually a very dangerous prediction because we are way below
the 160 K salary that this new employee is said to have in its previous company.
So if we trust this prediction, we would actually think this employee.
He's bluffing.
But no worries. We will not stop here.
Right now we are going to try a random forest with a lot more than ten trees.
So let's pick for example, 100 trees and let's see what we'll get.
So I'm going to rebuild the model.
Here we go.
And now let's look at the graphic results.
And as I was telling you we don't get much more steps
in this plot of our new random forest regression.
You know, we multiplied our number of trees by ten,
but the number of steps was definitely not multiplied by ten.
If we compare, we can compare that very quickly.
This is the previous plot.
And this is a new 110 trees, 100 trees.
We can see that we have maybe a little more steps,
but definitely not ten times the previous steps.
So the reason for this, the explanation
is related to this convergence idea that I talked to you about.
And so what changes here with 100 trees in terms of the plot
is not the number of steps there was increased,
but a better choice, a better location of the steps
in the stairs with respect to our salary axis.
That means that maybe the steps are better located to make our ultimate predictions
of the salaries of each of our level from 1 to 10 incremented by 0.1.
So to check that out, we simply need to make our
final prediction to predict the salary of this 6.5 level.
So let's recap the employees saying 160 K
a random forest with ten trees said 141 K.
And now let's see what say a random forest with 100 trees.
Execute.
And now it says 166 K.
So much better.
We're getting close to the suppose real salary of 160 K.
And besides we're now actually on the good side of negotiation
because we would no longer think that this employee is bluffing.
So since the prediction seems to be improving as we increase
the number of trees, let's actually try with 500 trees.
So that's a huge for us.
We have now.
So let's execute this to build our new huge forest of 500 trees.
Here we go. New forest created.
Let's have a quick look at the visualization plot results.
But it's going to be the same thing.
We will not get a lot of more stairs, maybe a little more.
Well, actually, let's check it out.
Well definitely not.
We seem to have the same number of steps in the stairs, but as I was telling you,
each of the steps in these stairs might actually be better located to make
each ultimate prediction of the salaries for each of the ten levels here.
So the best way to check that out is actually to get
our ultimate prediction of the salary of this 6.5 level.
And let's check it out.
Let's see if we get a better prediction than 166 K.
Executing.
And right in the spot, we hit the bullseye with 160 458
predicted salary.
So awesome job that this random forest with 500 trees just did here,
because it predicted almost the same salary as the supposed 160
K salary that this future employee set to have in its previous company.
And actually, so far before we made this random forest with 500
trees, the best model that made the closest prediction
to this 160 K salary was the polynomial regression model.
And now the random forest regression is beating the polynomial regression
model, because now we get a prediction that is almost the same as the real value.
So right in the spot.
Congratulations!
We actually made our final model.
And now we just want to conclude this tutorial by making this transition
to one of our future part, which is actually part ten in part.
And we will build some and simple machine learning models,
that is some models that are a combination of several machine learning models.
And you know, in machine learning these are actually the best models.
You know, when you have a team of several machine learning models,
they can actually make an awesome prediction
because unless we have a 19 machine learning model in our combination of
machine learning models, that is the only model to be right.
Well, you're more likely to get the correct prediction with ten machine
learning models predicting the same thing than with just one model.
So that's actually what we did here.
Well, we had a team of same machine learning models, which were decision tree
regression models.
But in the future we'll make a team of different machine learning models.
So that's going to be very fun.
That's going to be very powerful as well.
And I look forward to getting there with you.
So now I'm telling you congratulations for two things.
First, for building this very powerful regression
model, the random forest regression model.
And second, for having built all our regression models.
We built some linear regression models, some non-linear regression models,
some nonlinear non continuous regression models,
and some nonlinear non continuous and simple regression model.
So congratulations you're definitely on your way to becoming some experts
in machine learning.
But wait for what's coming next.
So speaking of what's coming next I look forward to seeing you
in the next sections or next parts.
And until then, enjoy machine learning.