And now next one is going to be.
Well, the other vector we want to concatenate
to that vector of predicted profit, which is the vector of real profits.
All right.
So here we can do this very efficiently because this is exactly the same trick.
I'm going to copy all this and paste
that here and just replace y pred by.
What do we have to replace y bread by.
Well of course we have to replace it by whitest
because whitest contains of course the real profit in the test set.
All right.
Here we are evaluating our model on the test set.
So here we go.
Replacing white bread by white test.
And here as well actually we could keep that
because the length of white test is the same as the length of white bread.
But there we go.
Now we have a beautiful concatenation of two vertical vectors.
But remember this.
You know this up to here is actually
the first argument of the concatenate function.
And therefore we need to add the second one
which is the axis as you can see.
So axis here can take two values 0 or 1.
Zero means that we want to do a vertical concatenation.
And one means that we want to do a horizontal concatenation.
And since here we want to concatenate two vertical vectors together.
Well that concatenation is actually horizontal.
And therefore we have to input here axis equals one.
And we don't have to specify
the name of the argument because this is input in the same order.
All right.
Okay good.
So now we're going to observe the final result and see
if our model was able to return some predictions.
You know, some predicted profits close to the real profit.
So there we go.
Let's press play to run the sale.
And awesome.
I didn't make any mistake. Perfect.
So let's recap.
We can clearly see that we have two vectors here.
That's the first one and that's the second one.
On the left we have the vector of predicted profit.
So that's why pred.
And on the right we have the vector of real profits for
of course the ten startups of the test set.
All right. And so let's see let's see what we get.
Let's see if our predicted profit are close to the real profit.
So for the first drop of the test set well the predicted profit is around 103,000.
And the real profit is actually 103,002 hundred.
So very close.
That's perfect. That's an amazing first prediction.
Then second startup of the test set.
The predicted profit is 132,582.
And the real profit is actually 144,000.
So not a great prediction like before, but still not too bad.
Third startup 132 146.
Still not great, but not too bad either for startup
71 actually 72 and 78.
All right, so pretty close then 178 191 okay.
116 105.
So actually the first prediction was amazing.
But then you know the other ones are still quite good.
Then 6768 actually 81 okay.
98,090 7000.
Very good.
113,000 114,000 110,000.
Very, very good.
And 167,000 and 166,000 amazing predictions.
So we have some, you know, amazing predictions, very close
to the real profits and some okay predictions.
You know, okay, is there are not too far from the real results.
So here from what we see.
Well we could say that
the multiple linear regression is well adapted to this data set.
The data set does not necessarily have some perfect linear correlations.
However, you can be assured that with this linear regression class, well,
it was able to select the right features
with the right parameters to make these predictions.
And even if you tune your linear regression model by, for example, applying
backward elimination to select, you know, a team of more statistically significant
features, you will actually get similar results you can try.
That actually would be a good practice.
We actually do that in the R section.
But in terms of performance this won't change much.
And remember your goal is to be efficient when building
and testing your machine learning models.
So when you get such results with your multiple linear regression,
you know in real life you will actually try other models,
you will actually try other modules which you can tune also.
And then in the and you will compare the performance
of each of these models and select the best one.
So we'll talk about this again at the end of this section.
And also a lot important on model selection.
And so now I have to say congratulations because you now know how to build
another machine learning model which is multiple linear regression and therefore
which you can add in your toolkit thanks to this new code template.
Perfect. So now we're going to move on to R.
I remind that you don't have to master the two programing languages.
If you want to master to. That's fine.
Join me in the R tutorials.
And otherwise if you want to stick to Python,
well feel free to skip the R section and join us, Carol and I, in
the next section on polynomial regression, where you will learn
how to make predictions on a linear data set.
You know, on a data set with non linear relationships, therefore,
with which a multiple linear regression model would not be relevant.
So it's an absolutely necessary model to add in your toolkit.
And you will added in the next section.
Until then, enjoy machine learning.