All right, so that's the problem.
I hope you like it.
I hope you're excited to work on it.
And so now we're gonna, without further ado, start
our logistic regression implementation on your favorite IDE.
Whether it is Google Colaboratory or Jupyter Notebook, you have the choice.
But my favorite is by far Google Colaboratory.
So if you love it to follow me here and now, let's re-implement
this logistic regression implementation step by step.
Right now it is laying out the notebook and we were about to have it in a second.
There we go.
All right.
So that's the whole notebook.
It is in Read-Only mode.
So right now what we have to do is to create a copy of this notebook.
And to do this we just have to click save a Copy and drive.
And this will create a copy.
As you can see of this notebook in which we will be able
to re-implement the whole model from scratch.
All right. Great.
So as usual, the first thing we're going to do is to delete all the code cells.
Right. Because I want you to take action.
I want you to learn by doing so
I really, really want you to reimplement all these code cells from scratch.
So we're going to delete all of them.
To do this we just have to click them and then click the trash button.
Here. Just do as I do.
All right.
And make sure not to delete the text cells
because we want to keep that well highlighted structure.
All right features killing.
So yes they will be feature scaling for logistic regression.
And I will explain why. All right.
So now we train the logistic regression model predict a new result.
All right.
And you really have everything in this implementation.
You'll see that you will learn how to predict an ensemble of results.
You know in the test set.
You will also learn how to predict a single result.
Like, you know,
when you deploy your model in production,
when you want to predict a single observation.
So now confusion matrix
that's to evaluate your model and of course the visualizations at the.
And once again I chose a data set of only two features right.
The age and the estimated salary, so that we can indeed visualize
the results in the end on the training set and on the test set.
Because remember, in the plot, each dimension corresponds to one feature,
and therefore there are as many dimensions as there are features.
And so since we have two features, we'll have a nice 2D plot.
And that's exactly the reason why I needed to take two features.
But no worries, the implementations were able to make works
for any data set regardless the number of features.
And I will prove this to you at the end of this part.
When deploying all our classification models
on a brand new generic data set with more features.
And this is how I will also teach you on how to select the best model.
All right, so there you go.
I hope you're excited.
You know, both by the problem case study and this implementation.
And now before we finish and move on to the next tutorial,
well I would like you to do a little exercise.
Now that you saw the data set and understands it.
And since you also have your data preprocessing template, well there you go.
The exercise is I would like you to implement
on your own the data preprocessing phase up to this step.
You know feature scaling.
So basically
I would like to implement on your own this step importing the libraries.
Then this step importing the data set
and this step splitting the data set into the training set and test it.
And finally this last step of the data preprocessing phase feature scaling.
All right.
So please try use of course your data preprocessing template
and of course your data preprocessing toolkit.
Because indeed in order to implement that step you will need to grab a tool
of your data preprocessing toolkit and I'm sure you will find it.
So you can totally do this on your own.
There is no trap. It's actually super easy.
And of course we will implement the solution together
in the next tutorial, so I can't wait to see what you end up with.
And I'm sure we will end up with the same thing.
So let's see. And until then, enjoy machine learning.