Hello and welcome to this art tutorial.
Well, I. Hope the homework went well.
I hope you've.
Obtained some interesting results and without waiting,
I'm going to complete the backward elimination here on R.
So that you can see if you obtain the same results as what we are about to.
Obtain, and mostly so that you can see how we complete.
Backward.
Elimination and are up. To the end.
So let's do that.
So in the previous tutorial we. Went up.
To building this regressor without the state.
Independent variable.
And that's completed the.
Step five here.
Of the backward elimination algorithm.
And so now we need to.
Go back to step three to look.
Again for the independent variable that. Has the highest p value.
And then we need to compare it to the significance level.
To decide.
If we need to remove this independent variable.
With the highest p value.
So let's do this.
It's actually already ready.
We just need to select this.
And press Command and control.
Press enter to execute.
And here it is perfect.
So let's move that up.
All right.
So as you can see. Here we have the new formula.
Prophet expressed.
As a linear combination of all the independent variables.
Except for this state.
So that's fine.
And here therefore.
We have the p values for these new.
Team of three independent variables.
All right.
And now what. Do we see here.
Okay.
So we can see that of course the already spent is still
highly statistically significant with three stars.
Here and a very. Low p value.
And mostly what do we need to do now.
We need to look for the highest p value.
And that's actually this 10.6.
Oh to 60%.
60% is definitely a very high p value, way.
Above the significance level of 5%.
So definitely administration is not.
Statistically. Significant.
That is administration has no effect on the dependent variable profit.
So great. That's pretty clear.
We need to remove administration from or regression equation.
So let's do this.
As usual. We're going to. Copy this
copy paste.
And here will simply remove administration.
There we go.
And now we have our new regressor.
Ready with.
Only two independent variables
composed of already spent which we already know is highly.
Statistic. Significant.
And the marketing spend marketing spend.
So far the p value. Is 10%.
Let's see what it will become.
So I'm actually going to build this new model by executing this.
So command and control plus enter to execute.
Here we go.
And now let's find out about.
The statistical results of this new.
Regression model.
Let's select this.
Press Command and Control plus enter to. Execute.
And here are the new. Statistical results.
With only the p values
of the two independent variables already spent and marketing spend.
Okay, so let's see.
Wow there is something interesting here.
Can you see it.
Well first participant is still highly statistically significant.
No surprise about that.
But we actually. Have one surprise here.
Remember the p value of the marketing spend was 10% at the previous step.
Now it's 6%.
And actually we want a dot here.
You know we.
Jumped from this category between 10% and one.
To this. Category between 5% and 10%.
So we actually have.
A dot now for this marketing spend independent variable.
Plus it's very close to the significance level.
It's very close to 5%.
You know for example, if our significance level was.
7% we would have kept this.
Independent variable marketing spend.
So it's kind of arbitrary.
You know, we we.
Don't know if we really need to remove.
This just because. Our backward elimination.
Tells us to, due to the fact that.
We made an arbitrary. Choice of.
5% for the significance level.
So since this is a tutorial.
About backward elimination, we will actually remove. It.
But this will not be our final.
Word because at the end of this part, there will be this.
Section about evaluating model's performance.
And we will actually add a criterion to make.
A better call at deciding.
If we really need to remove this marketing spend.
Because right now, the call
to remove this marketing spend independent variable is arbitrary.
So we will remove it because we want to follow thoroughly.
The backward elimination algorithm.
But keep that in mind
that it's not a final word about deciding what's the final time is going.
To be, and then we will get back to this.
Problem later in this. Course that is.
Later in this part.
To make a better call about whether we need to remove yes or no marketing spent.
So let's remove it for now.
That's actually the final solution.
But it's really a good choice of yours.
If you actually decided to keep marketing spend, you will be proud of this choice.
At the end of this part.
So congratulations!
Anyway, if you decided to keep marketing.
Spend and of course, also congratulations to the.
Others who decided.
To remove marketing spend because that means.
You just followed thoroughly the.
Backward elimination algorithm.
So congratulations to both of you.
And let's finish this backward elimination algorithm.
Because actually, you know, this is definitely the final step.
We have only one independent variable left R&D spend.
And we already know it's highly. Statistically. Significant.
But let's actually make this model.
By selecting. And executing this.
Here we go model created.
And now let's have a final.
Look at the statistical.
Informations of our model.
So let's press.
Command and Control plus enter to. Execute.
And here are the final informations of the final optimal team
a team that is actually composed of one independent variable.
So that's actually funny to call. It a team.
But anyway that's just a team of.
One that happens. But wait for the final.
Part to see if a team.
Of one can really be the best team.
So that's it.
We actually completed backward elimination.
Our final model is composed of only one independent variable, the R&D spend.
And we can clearly.
See that this. Independent variable.
Is highly statistically.
Significant, not only because.
We have three stars here,
but also because the p value is really, really small.
So definitely that's a very.
Precious information for the investors.
That should really look at.
This independent. Variable to add.
Another criterion into their investment decisions.
So again, congratulations.
To both of you who.
Either found a final team of only one independent variable,
the R&D spend or a final team of two
independent variables the R&D spend and the marketing spend.
And for those of you who found another team, make sure to compare.
The steps that you did yourself
with the steps that we did in this tutorial to spot which.
Difference led you to different results.
You can always ask me some questions in the Q&A.
I'll be happy to help you with your model.
But clearly the final team is either the R&D spend or the R&D
spend, plus the marketing spend.
And that's where. We also. Obtain in Python.
And that's what you will also.
Obtain in some other programing language or machine learning package.
So thank you. For watching this tutorial.
Congratulations again.
I hope you enjoyed doing this homework.
You will have some other homeworks in the other parts.
So you'll definitely practice which will help you shape your expertise.
In machine learning.
And speaking of machine learning,
I look forward to seeing you in the next tutorial.
And until then, enjoy machine learning.