Hello, my friends.
All right, let's see if you got this right.
So what did we have to do?
Well, first, the first natural step was to go to our data preprocessing.
Template. To grab all the.
Essential tools, which are indeed.
Well, the first steps of the data preprocessing phase.
So let's do this.
That's the first thing you were supposed to do.
So I'm copying this cell.
And then I'm. Basing it right here.
In a new.
Code cell for importing the libraries.
There we go. First step done.
Now to import. The data set.
Well same. Let's go to our data preprocessing.
Template which indeed is meant.
For us to be. Efficient.
So I'm.
Copying this. And then.
We'll see what we have to replace.
But once again it is. Supposed to help you so.
That you don't have to do much.
All right. So just pasted it.
And let's do you know.
Just this for the last step of the data preprocessing phase.
You know, in any situation.
Regardless of whether or not.
Is needed, feature scaling.
All right.
So let's take that cell here. And.
Let's copy that right here.
In a new. Code cell.
All right. So that's the first essential steps.
You know, which have been most of the time when building a machine learning model.
All right. So now next step.
What do we have. To change inside.
This data preprocessing phase.
Well let's take it step by step.
First step.
Of course we. Don't have anything to change.
Now let's see.
Second step. Well, there you go.
Of course. Here we have. To change the name of the.
Data set.
It is not data dot CSV, but it is now
social network ads dot CSV.
So let's do this.
Let's just replace this.
That was what you had to do next.
Social network underscore.
Ads dot CSV.
And now next question.
Do we have to change anything here.
Well of course the answer is no.
No, because. This data.
Preprocessing template was meant.
For. You to not have to change anything in most situations, as.
Long as of course,
you make sure that in your data set you have the features in the.
First columns, you know these are the. Two features here.
And the dependent variable in the last column.
And since.
This automatically selects all.
The columns except.
The last. One and this automatically. Selects the.
Last column in this. Of course, regardless of.
The number of. Features you have in your data set.
Well, there you go.
This will simply select.
The age and.
Salary. In the matrix of. Features.
And this line will simply select.
Well.
The dependent variable in a nice 1D. Vector.
All right so there you go.
That was the reason why I said it was so easy.
You only had to change the name of the dataset here.
Social network.
Ads dot CSV. Okay.
And actually speaking of the dataset, now that.
We have the code to.
Import. It, well let's not forget to.
Upload it in a notebook because in the same tutorial.
We will actually. Run these. For cells.
But before let's make sure to.
Finish implementing them. So here.
We are connecting to a runtime to enable.
File. Browsing. And in a second there you go.
We should have the upload button.
So now we're going to click. It to find our.
Whole machine learning dataset. Folder.
And we're going to go inside.
Then we're going to go to part three classification.
Then section 14. Logistic.
Regression Python.
And we're going to select our social.
Network. Ads data set.
It is executive same with of course the H here the estimated.
Salary and the purchase. Columns. There we go.
Let's click. Open.
It is going to upload. It in our notebook.
As we can see here.
There you go. Perfect. We have it.
So now we're ready to import it. But first.
I want to finish the implementation.
Of this data preprocessing phase.
So let's. Move on here to the next. Step.
Splitting the data set into the training set and test it.
And here do we have anything to change.
Well there you go again. Of course.
No it is not.
Compulsory to.
Change anything here. This will.
Automatically. Create your.
Training set and a test.
Set out of the whole.
Data set.
You know the whole data set composed of the.
Matrix of features X.
And the dependent. Variable vector y.
We're going to do some. Prints right to show. You everything.
Because then, you know the next.
Step is to apply feature. Scaling.
And before.
We get to this well I just would like to. Change something here.
But again that was. Absolute.
Not necessary.
You could totally leave it like that.
But I. Just want to change the.
Test size because.
Since.
Actually we have 400 observations.
In total, you know, we.
Have 400. Customers in this data. Set.
Well, you know, if we choose a test size of.
Oh point 25, it will be nice because.
We will have actually three.
Hundred customers in the training set and 100 customers in the test.
Set right will. Have nice round numbers.
So just exceptionally here, I.
Usually recommend. Indeed oh. Point two.
As a test size, but oh. Point 25 is.
Actually totally fine.
We will have a nice training set of 300 customers and one nice test.
Set. Of 100 customers.
So there. You go.
Now we can move on to the next step.
Feature scaling. Okay.
All right.
So how are.
We going to implement feature scaling. Here.
Well there is nothing more simple.
Thanks to our data preprocessing toolkit which I've put here.
And if you haven't.
Well grab it.
In part one data preprocessing.
And now in our toolkit we're going to scroll down
to the bottom to find that feature scaling tool, which.
Is actually the. Last one right. Here.
It is that feature scaling.
So here we go. Let's grab it.
You know you just have to grab the first cell.
Implementing the tool.
Now let's. Go back to our logistic regression.
Implementation.
Let's create a new cut cell here for feature scaling.
And let's. Paste it. Right inside.