Are you ready?
Let's do this.
Let's start implementing our multiple linear regression model.
So I just double clicked on it.
If you like Google Collaboratory, feel free to open this link with me.
Open with Google Collaboratory.
And if you don't like Google Collaboratory, that's totally fine.
You can open this file with Jupyter Notebook,
but from your folder, which you downloaded on your machine.
All right, choose your favorite.
And here we go.
Let's implement our multiple linear regression model.
All right.
So first remember that this file is in
read only mode which means that we can't modify it.
But no worries we're going to create a copy right away by going to file here.
And then click save a copy in drive.
This will as you can see, create a copy in which we will be able to re-implement
this multiple linear regression model from scratch.
Because indeed, I remind that this course is an action based course
in which I want you to take action as much as you can.
And therefore, we are going to re-implement
this whole model from scratch together, step by step.
And I really want you to code with me at the same time so that, you know,
the practical skill can really be well integrated in your head.
Okay, so let's do this.
Let's first start by removing old code cells here and only the code cells,
not the text cells because I want to keep that well highlighted structure
for this implementation.
So here I'm just removing all the code cells.
There we go. And perfect.
So this is the whole structure of this implementation.
We can have a look at it here.
And indeed that's why you know I wanted to brainstorm
on the dataset with you first before showing you the structure
in order to make you think what we must do in the data preprocessing phase.
And as we said,
we need first to import the libraries, then import the data set, that's for sure.
And then here we go.
We need to encode the categorical data.
And more specifically that state column which contains needs three categories.
And then of course we split the data set into the training set and test it.
That's a must.
And that will close the data preprocessing phase.
And we will all be ready to start training while first building
and then training the multiple linear regression model on the training set.
And by doing this, our model will understand the correlations
between all these spans of, you know, those stories and their generated profit.
And so there we go.
We will get a smart model which we will be able to use on new observations.
And that's exactly what we'll do as a last step here to predict the test
set results.