So let's do this.
Let's be efficient and copy this line, because we will only need to change
a few things.
But you're going to see that this time.
It's not going to be that simple as here.
It's going to be simple, but not that simple.
We just need to add several arguments. And why is that?
The reason is very logic.
It's because since our polynomial regression model
learns the correlations on this data set containing the level column
and also the level two, level three and level four columns.
Well, when we create this new data frame containing
only the 6.5 level observation.
Well, since our polynomial regressor is based upon these four columns here
level level two, level three and level four,
then that means that
in this new observation cell that we created for our level 6.5,
we not only need to input the level,
but also the level to the level three and the level four.
And that's what's going to change here.
That's the only thing that is a little less simple than what we did before.
But it's still very simple because as you can see,
it will be very quick and easy to add this values.
So let's do this. Let's not forget to change.
Of course the regressor here, it's not linear anymore.
It's poly rag because poly rag is the name
we gave to our polynomial regression regressor in this formula right here
okay.
And so now as I just explained we just need to add here
the polynomial features of our levels.
So that means that we need to add level two right here.
And don't worry we don't need to compute it ourselves.
We just need to add here 6.5
squared.
And that will do it because you know level two contains
the square values of the values in the level column.
And that's why here we add level two equals 6.5 squared.
And same for the other levels.
We actually made fourth degree polynomial regression model.
So we need to add here four levels.
And so I'm adding here level three equals 6.5 at the power of three.
And our last level level four equals 6.5 at the power four.
And that's it.
It was only this little less simple thing to do.
But now it's ready.
So let's check it out.
And actually we're about to find out the final verdict of the heart of the
negotiation, which is the most accurate predicted salary
that this future potential employee had in its previous company.
So let's find out. I'm going to select all this
and press Command and Control.
Press enter to execute.
Here we go.
So what is the final value.
It's $158,000.
So very close to what the employee said.
He said 160 K.
And we predicted 158 K.
So that's awesome news because not only we can proceed
to the right direction of our negotiation, but also we can now be relieved
that this new future potential employee is very honest.
And that's one of the best quality to have in life, including professional life.
So verdict is it truth or bluff?
Well, the final verdict is truth.
So we are ending this tutorial as well as this section about polynomial regression.
On a good note.
So happy ending.
Not only the verdict is truth, but also we can be proud
of having built your very first non-linear regression model.
So congratulations again and you're going to see that in the next sections
we will be introduced to some new non-linear regression models.
And some of them are fascinating.
So you'll see I look forward to seeing you in the next section.
I'll just add the final tutorial here.
But that's not to build any more model, it's
just that we're going to make a regression template,
you know, to build a lot more efficiently.
The next regression models, you will have of course, the code templates.
And you'll see how it will be very useful.
So I look forward to seeing you in the next section.
Congratulations again.
And until then, enjoy machine learning.