Hello my friends.
I hope you're feeling amazing,
and I hope mostly that you tried predicting that new result yourself.
And if you did, I'm sure you succeeded and if not, that's okay,
because we're now about to succeed together.
All right, so let's do this.
Let's create a new coattail here to make that prediction.
And so now, you know, with what we did previously with the SVR, it's
going to seem so simple because indeed, in order
to make that prediction, since there was no feature scaling
needed for decision tree regression, well, we just have to take our regressor
from which we just need to call the predict method.
And then inside where do we have to input.
Well no transform method of course because there was no feature scaling,
but only that observation 6.5
for which we would like to have the corresponding salary.
And then remember how we need to format that single position level of 6.5.
We have to put it, of course, in a 2D array by adding here
a double pair of square brackets
inside, which will put your observation 6.5.
All right.
As simple as that.
And now well the exercise is done.
We are ready to get this prediction, this predicted salary of the position
level 6.5.
So let's see.
Let's see what our decision tree regression model returns
compared to not only the previous predictions of our other regression
models, but also, you know, compared to what this person
mentioned earn in this previous company.
All right.
So let's execute the cell and the predicted salary of the decision
tree regression model for our specific case study
is $150,000.
So before we make any comment on this, because, you know,
if we really stick
to the scenario of our case study, well, this prediction would actually be bad
because it would be lower than the requested
salary of this employee, and therefore that would not be good.
But let's not comment on this, because then you'll see, as I told you, that
the visualization of the decision tree regression results will not be pretty.
And that's because, as I told you at the beginning of this section,
the decision tree regression model is clearly not the best model
to use on a single feature data set, right?
It is more adapted to data sets with many features, a high dimensional data set.
And that's totally fine, because the code we are implementing here
can be very easily used on other data sets with other features.
That's what I explained in the first tutorial of this section
with you know that only 1 or 2 changes to make in the data preprocessing phase,
but I still want to show you
the visualization results, because we can only do this in 2D.
You know, that's why I chose this simple data set.
It's in order to show you at the end
what the regression curve looks like for each of the regression models.
And so we're going to still visualize that for the decision tree regression model.
But you will see that it will be clearly not well adapted.
All right.
So congratulation for that prediction.
And now in the final tutorial of this section we will plot the decision
tree regression curve in high resolution to see what it looks like.
And until then, enjoy machine learning.