Hello my friends.
Welcome to this new practical activity
and the first practical activity actually of part three classification.
I'm super excited as you might hear by the sound of my voice,
because this is one of my favorite parts.
And actually you will see that
the case study we will do together is pretty fun, so I can't wait to start.
Welcome back.
And so now here we go.
We are about to enter a new branch of machine learning where
this time we want predict a continuous numerical value
like in part two regression.
But this time we will predict a category.
You know, a class like for example, you know, a binary variable 0 or 1, one.
The classic example is actually to do classification to predict
a tumor, you know, whether a tumor is benign or malignant.
And this is actually the case that we will do at the end, you know,
when I will teach you on how to select the best classification model,
but that will come at the end.
First, we will do a fun case study
with which we will learn how to build each of our classification models.
And there you go my friends.
It is in this tutorial that I will explain the problem of this case study.
All right, so before we start, let's just make sure once again
everyone here is on the same page.
So right before this tutorial I give you the link to this folder
containing all the codes and data sets in the ten parts.
So make sure to connect to that link.
And now now we should all be on the same page.
And there you go.
We're going to go into part three classification
to tackle our first model logistic regression.
I hope you enjoyed the intuition lectures and mostly that you are now ready
to put your well learned theory into practice.
And we're going to put it into practice first with Python, with which
we're going to re-implement from scratch and step by step
the whole logistic regression implementation.
So as you can see in this Python folder, you have two files.
First, well that logistic regression implementation in ipynb format
which you can open with either Google Colaboratory or Jupyter Notebook,
and you have the data set which is called social network ads.
So let's open it.
And now let me explain what the problem is about.
All right.
So let's imagine our favorite car company.
I won't mention name here because I don't want to do any kind of advertising.
But let's imagine your favorite car company.
And let's imagine that you are a data scientist for that company.
And your mission, should you choose to accept it, is to predict
which of your previous customers will buy
a brand new, beautiful SUV
just created by your favorite car company.
All right, so your favorite car company has just released
this brand new, beautiful, irresistible SUV.
And the general manager of this car company has asked you,
you know, the most talented data scientists of the company
to predict which customers will buy that new SUV.
You know, with the highest conversion rate.
And to help you, because, you know,
this general manager has some minimum data science skills and knows
and understands that in order to predict this, you need data right?
Your data on which to train your classification model
to predict what needs to be predicted, meaning
which customers will buy that brand new SUV.
And so there you go.
That's exactly the data that your general manager gave you.
And then this data set.
Well, each row corresponds to different customers.
And for each of these customers, there you go.
I'm about to reveal the features and the dependent variable
for each of these customers.
Well, this general manager collected the age
and it collected the estimated salary.
Because, you know, when a customer buys a new car with some kind of credit
or whatever, well, it has to provide estimated salary in the form.
So that's how it got the estimated salary.
And finally, that's your dependent variable.
Of course, the purchased variable telling whether or not
these customers have bought previously
some older SUVs of this car company. Right.
So this car company has basically many makes and models of SUVs and all the
zeros.
And the ones that you see here for each customer is seeing whether or not
these customers have bought one of these previous SUV
so that your model will be trained on this data set.
And for new customers, you know, having a different age
and a different estimated salary.
Well, we will predict if yes or no, they will buy that new SUV.
Okay.
So of course, in this dependent variable purchased
zero means that the customer didn't buy any previous SUV.
And one means that the customer but some previous SUV's all right.
And therefore all the future predictions that will be equal to one
will probably mean that the customer has a high chance to buy the new SUV.
If, of course, we offer a great deal.
And finally, once we predict the customers that are going to buy the SUV,
well, the final step of the strategy will be for the advertising team
to post ads of this brand new SUV on social networks,
and these ads will be targeted to the customers where we predict one,
you know, where we predict that they're going to buy that new SUV.
All right.
So you see the idea, the predictive model will target your customers.
And then the advertising team will use the results of this predictive model
to optimize the targeting of future customers.
And that is why,
you know, the name of the data set is called Social Network AD dot CSV.