All right.
Great.
So now they're all copies.
Therefore we can modify them.
Let me just show you once again how I modified the original classification code.
We made before to these new ones, you know, more simplified ones,
which will get you the accuracy quickly and efficiently.
So the data preprocessing phase I kept exactly the same, including,
you know, the feature scaling applied to x ray, the next test.
But here I put a template name and I highlighted
that you have to enter the name of your data set here.
So that's what we'll do I'll show you.
But that's the only thing that was changed.
Indeed.
We don't have to do much else because this will automatically select
all the features and not your dependent variable.
And this will automatically select your dependent variable.
And that's provided of course you have in your data set.
First the features you know in the first columns
and last the dependent variable in the last column.
Right. Make sure of this.
What we're going to do now works for any data sets, regardless
of the number of features.
As long as they have the features in the first columns
and the dependent variable in the last column.
Make sure to remember this.
All right. And then all good here.
If you want, you can change that from oh point 25 to 0.2.
But that's fine.
Both values work well then feature scaling.
All right then for each of the classification model,
I kept, you know, the code to implement and train it.
And finally what I did in the last cells is simply I removed,
you know, the prints that displayed the vector of predictions and the vector
real results next to each other, because,
you know, we don't really need it for our model selection process.
However, what I did is that I kept this, of course,
but in order to compute the confusion matrix and the accuracy,
I had to create that y print vector containing all the predictions
by calling to predict method apply to x test from our classifier.
And that's all I did.
And I did the same in all the different files.
Right?
K-nearest neighbors data preprocessing, phase training and confusion matrix.
Same support vector machine.
Data preprocessing training and confusion matrix.
Then kernel SVM, same data preprocessing, phase training and confusion matrix.
Naive Bayes data preprocessing, phase training
and confusion matrix and decision tree classification.
Data preprocessing.
Phase training, confusion matrix and finally random forest
data preprocessing, phase training and confusion matrix C.
So you have the exact same code templates for each of the classification models
we built together.
The only thing that changed is actually this cell,
because this cell actually builds and train the classification model.
You want to try through this model selection process.
All right. Perfect.
So now we're getting very close to the demo.
And so just to recap this demo works for any data set.
Regard list of the number of features.
And as long as you have your features in the first columns
and your dependent variable in the last column,
and also as long as you don't have
some special data preprocessing tools to use on your data set.
If you have any categorical variables you know in strings
or categorical variables where you have to perform one hot encoding
well, don't forget to use your data preprocessing toolkit to preprocess
the right way your data set,
and then you can just deploy all your classification code templates here.
And that, my friends, is exactly what I'm about to show you right now.
So now the demo is going to start.
Are you ready?
Three. Two one go. All right.
So I'm going to do this
as efficiently as I can in order to show you the power of code templates.
So first step the first step is to upload the data set inside the notebook.
Right now it is connecting to runtime to enable file browsing.
Actually I'm going to do this for
each of the models here because you know it always takes a few seconds.
So let's do it this way to be efficient. Right.
So I'm just you know, loading all the files here.
All right. Perfect.
And everything.
You know every file is now connecting to a runtime.
Now be careful.
If you don't see the sample data here you have to refresh.
Otherwise you will have issues uploading your data set.
Good. Now it's good.
So the next step we upload the data set.
All right.
So this is the model selection folder and more precisely the classification folder.
But let me show you the path again
I put this machine learning model selection folder into my desktop.
But make sure to find it on your machine wherever it is.
If you have not downloaded that already,
make sure to download it right before this tutorial.
In the article you will find the link at the bottom of the article.
Then together we're going to go inside, then inside classification
and there we go.
We select data dot csv, then we click open.
Then we press okay.
And then what we simply need to do inside this code
template is just to put here the name of the data set.
So you just double click this and then enter data that CSV
or you know the name of your future data set.
All right. And that's it.
That's all we have to do in each code template.
Only one thing to change so that we can really call it a curved template.
All right. Great.
So now we're going to do the same in each other implementation.
So now k nearest neighbors.
Let's refresh this because we need to see this. There we go.
Then upload then data dot CSV then open.
All right. Perfect okay.
And then we replace here the name by data dot CSV.
Perfect.
Then next one support vector machine refresh upload.
Then data dot CSV then open and perfect.
We have the data set.
Now we replace this by data dot CSV and all good SVM is ready now.
Kernel SVM refresh
upload data
dot CSV open okay
replacing this by data dot CSV or the name of your future data set.
And there we go. Kernel SVM is ready.
All right then Naive Bayes refresh
upload data dot CSV open okay.
And then replacing this by data dot CSV.