And now what is this data set about?
Well, that's a classic data set from actually the UCI Machine
Learning Repository, which I encourage you to have a look,
because indeed it is a website
that contains a lot of data sets on which you can practice.
And this one is actually called combined cycle Power Plant.
And it consists of trying to predict this
dependent variable which is actually an energy output.
And don't worry, you don't have to understand
how energy works or how the physics of this data set works.
The only thing that you need to understand is that we want to predict
this dependent variable, which turns out to be an energy output,
and we are predicting this dependent variable with these four features here,
which are first the engine temperature, second, the exhaust vacuum,
third, the ambient pressure, and fourth the relative humidity.
All right. So that's that's only what matters here.
You have to see it as you know, a general data set where you have
several features that you're going to use to predict that dependent variable.
And as you can see,
the condition, you know, in order to deploy our regression
models on this data set in the future, data sets you'll be working on
is to have in the first columns the features
and in the last column the dependent variable.
All right. That's all that matters.
If you have a data set like that which has no missing data and no categorical data.
Well, you can deploy each and every single one of these regression
models by just having to change the name of your data set.
And if your data set has missing data or categorical data,
you just have to go to your data preprocessing toolkit
to take care of this.
And then you can deploy these models.
All right.
So now time for the demo I'm going to show you
how are we going to quickly
and efficiently plug and play each of these regression templates
by only having to change the name of the data set.
And then I'll show you how we will quickly identify and select
the best regression model for this particular dataset.
All right let's do this.
So our first step here will be to create a copy of each of these files.
Because these are all in read only mode
because you know this folder was shared to you.
So since all of you will access it, you can of course not modify it directly,
but in order to modify it, you just need to create a copy in your drive.
And to do this well, we can just do a right click here and then make a copy.
So we're going to do this for each of the regression models here.
Let's do this.
Make a copy for multiple linear regression.
Then make a copy.
Then random forest regression make a copy.
And finally support vector regression.
And there we go.
All right. Good.
So we made a copy of each of these regression models.
And the copies should be either on your main drive
or in this Colab notebooks folder.
And well as you can see they are on my main drive.
So you will actually very easily find them.
And now what we're going to do is open each of these files
in order to proceed with the demo.
All right.
So I have first multiple linear regression.
Then I'm going to open polynomial regression.
You know, in the same order as the one we used
to build our regression models then support vector regression.
Once again you can either
open them with Google Collaboratory or Jupyter Notebook,
or even Spyder Anaconda, because I also gave you the folder
containing all these codes and the data set
right before this tutorial in the article.
So then let's open decision trees
and finally well, random forest regression.
All right.
So actually let me put it like that.
You know the same order support vector decision tree and random forests.
All right.
So now we have all our regression models open.
I'm first going to show you the code templates one by one.
And then we will deploy them on the data set.
And I'll show you how to quickly figure out which one is the best model.
All right.
So starting with multiple linear regression let's see the different steps.
So we start by importing the libraries.
Of course that's the first step of the data preprocessing phase.
Then we import the data set.
And as you can see I made it super generic, meaning that
the only thing that you have to change is actually the name of your data set here.
That's why I specified in capital letters that you can't miss it.
Enter the name of your data set here and we will actually do that in a few minutes.
Then here you have nothing to change of course,
because this automatically select all the columns except the last one.
Therefore your features and this automatically selects
the last column meaning the dependent variable.
All right then we split the data set into the training set and a dataset.
Of course here that's very important to do this
because since we want to select the best model well we need this test set
in order to evaluate the performance
of each of them in order to compare it and select the best one.
So we have to do this step. Absolutely.
Then once we have, well the training sets, we will train our model
on the training set.
Then we will predict the test results, you know, to have a look
at the predictions and compare them to the real results in Y test.
And then finally we will evaluate the model performance.
And here I don't want to scroll down now because we will discover together
a bit later the code to evaluate a regression model.
You know, with the r squared coefficient.
All right.
So that's the code template for multiple linear regression.
And as I told you and as you see it is super generic
because for any of your future data set, provided
that they have in the first columns the features and in the last column
the dependent variable, and also provided that they don't have missing data
or categorical data.
Well, the only thing that you have to change
within this code template is just to enter the name of your data set here.
And that's it.
And by just doing this, you will be able to evaluate your model
with irrelevant metrics.