But according to you.
Is it going to be the best model?
Well, that's what
we're going to figure out very quickly, because then we're going to run
all the cells here for the polynomial regression.
There we go. As you can see, it's going very fast.
And well for the polynomial regression model with remember a degree of four
we get a final R-squared coefficient of oh point 9458.
So we've already built our multiple linear regression model
and therefore so far the best one is polynomial regression.
Feel free to actually test some other degrees if you want.
But now we're going to move on to support vector regression
and see if it's going to beat that polynomial regression.
I actually really like this model.
And usually I get the best results with this.
But let's see.
Let's run all the cells and in flashlight we'll get the final performance.
No not yet. Not yet actually.
And by very very short it beats indeed the polynomial regression model.
You know, oh point 9480.
And here we had actually oh point 9458.
So so far the best model is to support vector regression.
Can you see how we're doing super fast here. Right.
We only had to change the name of the data set here.
And all the rest is automatic.
And that's the beauty of code templates.
Now let's move on to the next one Decision tree regression.
And let's see if it can beat the support vector regression
which remember has opened 94 eight.
So let's see.
Let's run you know all the cells.
And the final result is oh point 92 two okay.
So that's actually the worst
I think it is indeed worse than the multiple linear regression. Yes.
So the decision tree regression model did not perform well here.
But maybe that's
because it didn't have enough team spirit to tackle these predictions.
And that's what we're going to figure out with random force regression.
Because indeed a random forest regression model is a bunch of trees
teaming up to return an ultimate prediction.
So now the ultimate question is, do you think that the final winner
of this competition is going to be the support vector
regression model, or the random forest regression model?
Take your bet and let's see if you're right.
So there we go.
We're about to find out in a second because we're going to click run all now.
And we're going to get the final final result with a final R-squared
coefficient of actually oh point 96, which therefore makes the random forest
regression the big winner of this data competition.
So congratulations.
In a very few seconds,
you were able to quickly identify and select the best regression model.
And mostly, you know,
the most important thing in all of this is to finally know how to answer
this very often asked question how do I select the best model?
And well, the answer is you simply try all of them and using the R-squared
coefficient, you compare them and conclude on which one is the best.
And in our situation here, you know, for this data set,
well the best is the random forest regression.
All right.
So congratulations.
Now you know a lot.
You know you have an expertise in regression models.
You not only know how to build them but also you have all these cool templates
which you can use very efficiently to select the best machine learning model
for your regression problem and that for any data set.
And remember, if your data set has missing data or categorical data,
well, you only have to grab your tools and the data preprocessing toolkit
to handle these situations.
And then you can deploy your code templates.
All right.
So I'm super excited and super happy.
Now that we completed 100% this part two on regression.
And now my friends we're going to move on to a brand new branch of machine learning
which is classification and which we're going to do
exactly the same, but this time to predict a category
and same as what we did for this regression branch.
Well, we will build several classification models.
And at the end I'll show you again how to select the best one.
So I can't wait to see you in this part three.
And until then enjoy machine learning.