And now we're actually going to understand why.
Why didn't the SVM model beat the K and then.
Okay. So we'll actually figure that out in a bit.
Or actually, you know,
I can just show it to you here on the original implementation of the SVM.
But you're going to understand now why it didn't beat it.
Well, there you go.
It didn't beat it because once again, since we chose a linear kernel,
well, the prediction boundary
or you know, the decision boundary is actually a once again a straight line.
And therefore even if you rotate it either this way, with this way, well,
it won't be able to catch the right predictions for, you know,
these green customers here, which should belong to the green regions.
And same for this one.
You know, if we rotated this way, well we will catch these ones.
But then we will catch more incorrect predictions around here.
And if we rotate this way, you know, from here to here, well, indeed
we will catch these ones in the right prediction region,
but we will get more incorrect ones here.
So that's the problem of linear models here.
Indeed, it's much better
to have a prediction boundary that does some kind of a curve here
in order to catch only the red customers who should be predicted
not by the SUV, and leave the green ones in the green region.
All right.
That's exactly what we got with our k nearest neighbors, right?
It is not a smooth curve, but it did the job of selecting the right
red customers here.
Still leaving some green ones,
but here catching the right green ones in the right region.
The green region.
And here of course, since we have this straight line, it's impossible to do.
But no worries.
I'm sure you have the intuition that once we use a nonlinear kernel,
well, we'll be able to catch the right green observations here in the right
green region.
And well, that's exactly what we'll find out in the next section.
When implementing the kernel SVM model.
All right. So let's see if we're done here.
Yes we are.
So it's finished to execute.
And of course we get the same results.
And let's see for the test set. Still running. But
and oh well okay.
So funny timing.
It just populated here
and well you know it's still the same because of this straight line here.
Well we have some green customers you know customers who.
But in reality the new SUV but couldn't be predicted correctly because they fall
in the wrong region because of this prediction boundary that cannot separate.
Well are two classes all right.
So same problem.
And you know you might guess that this problem will be fixed once
we choose a nonlinear kernel for our support vector machine model.
All right.
So let's find out about this in the next section on kernel SVM.
And until then enjoy machine learning.