Hello and welcome to the Machine Learning A to Z course.
Super excited to have you back here on board.
You might be wondering what's up with the timer?
Well, this tutorial is all about getting excited about machine learning,
and I've set the challenge of showing you
the power of machine learning in under five minutes.
So let's dive straight into it.
You are a data scientist working for a car company,
and you've been given this dataset
with ages and estimated salaries of potential customers.
Your task is to predict which ones of these customers are more likely
to purchase a car, based on a campaign that the sales division will be running.
The good news is that the sales division also gave you this data set,
which is data from a previous campaign, a very similar campaign
that ran in the past, which also has ages and estimated salaries of customers.
But it has an additional column which says whether that customer purchased the car
that they were advertised or whether they didn't purchase a car.
So this data set is the one we're going to use to build a model,
and then we're going to apply that model to this data set.
And we're going to be using a logistic regression model.
Excited. So my let's dive straight into it.
We're going to be using Python.
And we're going to be working in Google Colab which is a very popular tool.
As you can see we have some code pre-written here.
And we're going to walk through this code and run it step by step.
And you'll see the model getting built, which is very exciting.
Now let's take the first step and we'll load the data sets.
Here are the data sets.
We're going to click over here.
And I'm going to load them up.
All right so the data sets are loaded and we can proceed to our code. Now.
So there we go.
First thing we're going to do is we're going to import the libraries.
So we're going to open this up run these libraries.
And this will allow us to work with the data.
Next we're going to import the data set into our code so we can work with it
there.
There's you can see there's
the age estimated salary and whether or not a person purchased.
So that's a previous campaign.
Then we're going to plot the data set and see what it's all about.
Here we can see the blue dots represent people who purchase.
They're usually at a higher age or at a higher salary.
And people who didn't purchase are the red dots.
And of course there's a mix over there as well.
Now we're going to apply feature scaling.
We won't go into detail on what this is all about is just a very important step,
and you'll learn more about it inside the course for sure.
Next, we're going to train the logistic regression model.
And there we go.
logistic regression model is trained.
And logistic regression is just one of the models, a very popular one.
But definitely they are the ones which again, you will learn inside the course.
We're going to visual the visualize the model results.
And this will allow us to see what is going on
in our data and how the model is being applied to it.
So there we go.
There's our logistic regression model applied to the data.
As you can see, it's saying that anything above this blue line
means that the person will purchase or has purchased a car.
Anything below the line means that they won't.
and of course there are some mismatches with the blue and red dots.
And that's okay, because no model is perfect.
Those are just errors which are totally normal for models.
And in this course you will learn how to pick the right models
for the right applications and to minimize those errors.
Next we're going to import the new project data.
And there it is.
That's our new data that we need to predict.
we're going to apply our model to make those predictions.
And we will then visualize the predictions to see, the results.
So there we go.
Those are our results over here.
And as we can see the model is saying that anything above this blue line,
that those people will are likely
to purchase the car below the blue line are not likely to purchase.
So our marketing department can just simply target the people in the blue area.
And therefore save on costs and optimize their efforts,
focus their efforts, and get the best return on investment.
So there we go.
That's how easy it is to apply machine learning models.
As you can see, this took us under five minutes.
And of course this was a simplified approach.
We didn't do many of the steps,
like splitting the data into a training set and a test set.
We didn't, build a confusion matrix or calculate accuracy ratios
and lots of other nuances, all of which you will learn inside the course.
But in a nutshell, this is how machine learning works.
And this is the power of machine learning,
which already soon you will be able to apply in your career.
I hope you're excited and I can't wait to see you inside
the course, where we will learn a lot and have lots of fun along the way.
And until next time, enjoy machine learning!