Naive Bayes is ready.
So now let's move on to decision tree classification.
And there you go.
So that happens when you have too many sessions opened on the Google Colab.
I left it on purpose because I'm sure you will also encounter this situation
and what to do in this situation. Well, no worries at all.
That's very simple since Google
Colab actually allows only maximum five sessions to run at the same time.
Well, what we'll just do here is that for decision tree
classification and random forest, because here that's the same.
Well we'll just close them for now.
All right.
And we will reopen them after we get the best accuracy
from these five models okay.
So we'll get the best from these five.
Then we'll run the last two ones.
Decision tree classification and random forest classification.
And we'll see which one wins.
Which one is the big winner.
All right.
So now all are implementations already.
So of course next natural step now is to run
all these cells to get all the accuracies of these five models.
All right so let's start with logistic regression.
Are you ready.
Let's click run time and then run and all the cells will be running.
And we shouldn't get any error. Indeed.
And we get wow.
We start with a very good accuracy because we get an accuracy
close to 95% for logistic regression.
All right.
And indeed
we only have four plus five equals nine errors nine incorrect predictions.
Well pretty good.
So let's see what we get with the next ones. You know.
And it's really reassuring that we get these high accuracies
because we were doing predictions for breast cancer.
So we really want to, you know, be accurate on predicting
if patients have a benign or malignant tumor.
Okay.
So let's hope that we can do even better than this.
All right. So I'm going to scroll back up.
Oh no actually I'm going to leave that here in case we forget.
So 0.947.
Now let's move on to k nearest neighbors.
Let's click run time here then run all.
And there we go my friends.
We're about to get the next accuracy which is exactly this same one.
I just check that, you know I put the right model here.
But we have exactly the same one actually, which you know, can totally happen
because you just have to make nine incorrect predictions.
You know, two classification models can make the same number of incorrect
predictions, and therefore you will end up with the exact same accuracy.
So that's very interesting.
Actually, this is the first time I observe this.
All right.
So well let's still hope we can beat this with our next classification models.
So now with Support Vector Machine we're going to click run time.
And we're going to click Run All to see that next accuracy we're getting.
And all right interesting.
This time we get a lower accuracy but still a very very good one.
And you know that makes me very excited to see what kernel SVM is going to do.
You know with a nonlinear kernel.
Because indeed here we get ten incorrect predictions as opposed to nine
incorrect predictions before with logistic regression and K-nearest neighbors.
But here with SVM, it's still very, very good.
We get 94% accuracy.
All right. And now let's try kernel SVM.
I look forward to seeing what we're going to get.
So let's click run time.
And let's click run all.
And the accuracy is yes we beat it
95% 95.3%.
That's excellent.
And that was actually expected kernel SVM.
You know is really really good.
You will get good results with this because you know,
we get flexibility on the curve to catch the correct predictions.
All right. So very very good.
But we still have three other classification models.
Let's see what we're going to get with them starting with Naive Bayes.
All right.
So let's click run time and then run all
and and the next accuracy is okay.
So like SVM ten incorrect predictions resulting in an accuracy of 94%.
All right.
That's okay.
And now well we still have two more chances.
One was decision tree classification
and the other one with random forest classification.
So now what we're going to do is we're going to click runtime
here then manage sessions.
Then we're going to terminate all these sessions here.
Because you know we're only allowed to run maximum five sessions at the same time.
So I terminated all of them.
You can close it now. And we still keep the accuracy.
So that's totally fine right.
We keep the accuracy everywhere here.
So we can totally compare with our last two.
So let's do this.
Let's open first you know random forest classification because
you know it gives them in that order.
Well actually that doesn't really matter here.
But anyway let's open decision tree classification now.
All right.
And here we go.
We have our last two models I can't wait to try them
because I can't wait to see who is going to be the big winner.
And if we can beat even more that best accuracy of 95.3%.
All right.
So next step is not to click runtime here.
Because remember we haven't uploaded yet the data set into the notebook.
So no need for refresh here I'll good upload
then data dot CSV open.
Then let's do quickly the same for random forest classification.
But first let's not forget to replace this by data dot
CSV are good now random forest classification
little folder here, then upload,
then data dot csv open, then okay.
And then let's replace this by data dot CSV.
All right.
And now my friends we're about to reveal the final podium.
You know the three best models with the three highest accuracies.
So let's do this starting with decision tree classification.
So let's click run time here. Run all.
And now there we go.
Wow that's incredible.
We actually beat the accuracy I didn't I really didn't expect this.
Usually decision tree classification is not the winner.
But here we have a beautiful exception to the rule.
Indeed we get a beautiful accuracy of almost 96% 95.9.