All right, so we're almost ready to start.
Now we're going just to upload, you know, the data
sets by clicking this little folder here.
And then right now it is connecting to runtime to enable file browsing.
And in a second we should be able to see the upload button.
Here we go to upload.
Indeed the data set.
And now we are on my desktop.
That's where I put my machine learning.
It is a folder, but make sure to go wherever you saved it.
And now inside we're going to go to part two regression
and then decision tree regression and then Python.
And then there you go.
You select your position series data set and click open.
And this will upload the data set inside the notebook.
And now we're ready to start.
Let's just run these two cells here.
The first one to import the libraries.
And then the second one to import the data set.
All right. Perfect.
So now we have the data set.
And of course the matrix of features X containing only the position levels
and the dependent variable vector containing the salaries.
All right.
And here quick reminder this model that we were able to build.
You will totally be able to implement it on your data sets.
And you will only have two things to change which are first of course
the name of the data set.
Here you will put the name of your data set.
And then in a matrix of features.
Well maybe you will want to select all the columns.
And here we just excluded the first column because this contains only the
positions and strings which are exactly the same as the levels in this column.
So of course we didn't want to include it.
But check your data sets.
Check if you want to include all the columns, and mostly check
if you need to apply some of the tools of your data preprocessing toolkit,
which are either, you know, taking care of missing data
or encoding categorical data. Right?
So you would need to check the variables and see if there are some categorical
variables and strings.
If the order matters, like for example, the size of a clothes,
well you will apply label encoder.
And if the order doesn't matter, like some countries or some states,
well you will apply column transformer with one hot encoder.
All right.
And then you don't have to apply feature scaling.
You can totally split your data set into the training set and test it
if you want to evaluate your model on you observations.
But you don't have to apply feature scaling
for decision tree regression, and neither for random forest regression.
Why is that?
That's because you know the predictions
from a decision tree regression or random forest regression model, or results
from successive splits of the data, you know, through the different nodes
of your tree,
and therefore there are not some equations like with the previous models.
And that's why, of course, no feature scaling is needed
to, you know, split the different values of your feature
into these different categories, leading to different predictions.
We can still do this with the original scale of your features,
even if your features take different ranges of values.
All right.
So remember this no feature scaling.
And then check for the other tools.
But just for your future data sets where you would like
to apply decision tree regression okay.
Perfect. So we have everything. We have the data set.
And now we are ready to build the decision tree regression
model on the whole data set. Right. This time.
We don't want to split it.
We want to leverage the maximum data to understand the correlations
in this small amount of information.
So we will train it on the whole data set.
Then we will predict our final result.
You know the salary of the position table number 6.5.
And then at the end we will visualize what the regression
curve of the decision tree regression model looks like.
All right.
So let's do all this in the next three tutorials
starting with this step training the decision tree regression model.
On the whole data set.
And until then enjoy machine learning.