And now let's see.
Okay, so the random forest classifier definitely catches
most of the users that didn't buy the SUV in the right category.
That is the red region.
So that means that it classified well, most of the users who didn't buy the SUV.
And then for the green users who are the users but the SUV in reality,
because as we can see, most of them are in the right green region
and it's desperately trying to catch some outliers.
We can call them this way.
For example, this guy here is
a user that didn't buy the SUV in reality because this is a red point
and it is way into the green region here, as we can see.
But the random forest classifier managed to make this
little rectangle part of the region in red
to catch this user that didn't buy the SUV and classify it well.
But is it the smart way of doing it?
Is because what will tell you that for some new observations, we will have,
you know, some users who didn't buy the SUV in this red rectangle here.
So that looks like overfitting, because it made this red rectangle here
because we had this user indeed who didn't buy the SUV.
But nothing tells us that for some new observations,
we will have some users who didn't buy the SUV in this
red rectangle here, so we should be careful with that.
And same for this user here.
As you can see that this user is in some sort of a irregular red region here,
but fortunately our random forest classifier was not too obsessed
at making all the predictions correct.
Because as we can see, this red user here is in the green region.
So that means that it's still paid attention to overfitting,
but not too much. And we should be careful with that.
So speaking of overfitting, let's check that right now.
Let's look at the test results right now to see how this region is here.
Because you know the regions won't change.
These are the regions built by our model.
So when we look at the test results we will have the same red region
here with this rectangle here and green region here.
But what will change will be the test set observation points.
That is all the red points and the green points.
This will change
and we will see if we have some red points here in this rectangle here.
And actually probably not because this looks like overfitting
that occurred because our classifier was fitted too much to the training set.
So let's find out about that right now.
Let's select this section dedicated to visualize the test set results.
So I'll just select everything and press Command and Control plus enter to execute.
All right.
So what is the first thing you see here.
Well yes indeed.
This red rectangle here is totally and useful for some new observations.
So that was clearly a red rectangle region to catch some uses of the training set,
because our classifier was too much fitted to the training set.
And this red rectangle actually doesn't make any sense here
because indeed we don't have any red user in this rectangle region here.
Well, it's it's
not that it doesn't make any sense, but it's totally and useful here.
And besides, you know, we have this green point here and this green point
could have been in this region here that would make an incorrect prediction.
We were lucky on this one,
but this could have happened because these are new observations.
And now random forest classification machine learning
model didn't learn anything from this new observation points.
So this guy could totally have ended up here.
So lucky on this one.
And by the way, same for this region here we don't have any red user.
That is some user who didn't buy the SUV in this red region.
So this red region is totally and useful as well.
Okay so that's the idea.
But most of all it did a pretty good job because of course it got
most of the red users here with a low edge and low
estimated salary, and therefore users who didn't buy the SUV.
And most of the green users who are quite old with a higher
estimated salary, who bought this awesome, cheap luxury SUV?
Okay, and now what is the conclusion of all this?
Because we reached
the end of our classification adventure, we built all our classifiers.
So according to you,
what is the best classifier for this particular business problem?
What is the best one?
It should be a classifier that classified correctly the users who didn't buy
the SUV, and the users who bought the SUV, and at the same time
prevented overfitting in the training set to be able
to make some good new predictions of some new observations.
So in my opinion, the best classifier would be the kernel
SVM in terms of the balance between the percentage
of incorrect predictions and the fact that we want to prevent overfitting.
Well, if we look at them again, in my opinion
the kernel SVM classifier would be the best one.
All right. So that's the end of this tutorial.
And now I have to say congratulations,
because you built a great deal of classifiers from simple classifiers
with logistic regression to more sophisticated and more complex
classifiers like kernel, SVM or random forest classifiers.
But that's not the end of the journey.
In the next section, we will be talking about how to evaluate
the performance of our models and how we can improve them.
And then eventually we will have a homework on a real life data set,
where we will combine what we learned here about how to build some classifiers,
and all the next concept that we will learn
to evaluate the model performance in order to find the best model
for this real life business problem data set that you will be given and we will
do the job as a data scientist or machine learning scientist would do in reality.
So congratulations again.
I look forward to seeing you in the next section.
And until then, enjoy machine learning.