﻿1
00:00:00,433 --> 00:00:01,433
Hello my friends.

2
00:00:01,433 --> 00:00:02,833
I hope you're feeling amazing,

3
00:00:02,833 --> 00:00:07,133
and I hope mostly that you tried
predicting that new result yourself.

4
00:00:07,300 --> 00:00:10,966
And if you did, I'm sure you succeeded
and if not, that's okay,

5
00:00:10,966 --> 00:00:13,966
because we're now
about to succeed together.

6
00:00:14,066 --> 00:00:15,300
All right, so let's do this.

7
00:00:15,300 --> 00:00:19,500
Let's create a new coattail here
to make that prediction.

8
00:00:20,100 --> 00:00:24,100
And so now, you know, with what we did
previously with the SVR, it's

9
00:00:24,100 --> 00:00:26,933
going to seem so simple
because indeed, in order

10
00:00:26,933 --> 00:00:30,233
to make that prediction,
since there was no feature scaling

11
00:00:30,233 --> 00:00:34,266
needed for decision tree regression, well,
we just have to take our regressor

12
00:00:35,633 --> 00:00:38,766
from which
we just need to call the predict method.

13
00:00:39,066 --> 00:00:41,933
And then inside where do we have to input.

14
00:00:41,933 --> 00:00:46,100
Well no transform method of course
because there was no feature scaling,

15
00:00:46,200 --> 00:00:50,100
but only that observation 6.5

16
00:00:50,200 --> 00:00:53,200
for which we would like to have
the corresponding salary.

17
00:00:53,366 --> 00:00:58,800
And then remember how we need to format
that single position level of 6.5.

18
00:00:59,033 --> 00:01:03,733
We have to put it,
of course, in a 2D array by adding here

19
00:01:03,900 --> 00:01:06,866
a double pair of square brackets

20
00:01:06,866 --> 00:01:10,533
inside,
which will put your observation 6.5.

21
00:01:10,800 --> 00:01:11,700
All right.

22
00:01:11,700 --> 00:01:12,900
As simple as that.

23
00:01:12,900 --> 00:01:15,300
And now well the exercise is done.

24
00:01:15,300 --> 00:01:19,300
We are ready to get this prediction,
this predicted salary of the position

25
00:01:19,300 --> 00:01:20,800
level 6.5.

26
00:01:20,800 --> 00:01:21,833
So let's see.

27
00:01:21,833 --> 00:01:25,266
Let's see what our decision tree
regression model returns

28
00:01:25,500 --> 00:01:29,666
compared to not only the previous
predictions of our other regression

29
00:01:29,666 --> 00:01:33,366
models, but also,
you know, compared to what this person

30
00:01:33,366 --> 00:01:36,366
mentioned earn in this previous company.

31
00:01:36,600 --> 00:01:36,966
All right.

32
00:01:36,966 --> 00:01:41,400
So let's execute the cell
and the predicted salary of the decision

33
00:01:41,400 --> 00:01:44,400
tree regression model
for our specific case study

34
00:01:44,700 --> 00:01:47,700
is $150,000.

35
00:01:47,700 --> 00:01:50,766
So before we make any comment on this,
because, you know,

36
00:01:51,000 --> 00:01:52,000
if we really stick

37
00:01:52,000 --> 00:01:56,200
to the scenario of our case study, well,
this prediction would actually be bad

38
00:01:56,233 --> 00:01:59,866
because it would be lower
than the requested

39
00:01:59,866 --> 00:02:03,033
salary of this employee,
and therefore that would not be good.

40
00:02:03,033 --> 00:02:07,666
But let's not comment on this, because
then you'll see, as I told you, that

41
00:02:08,333 --> 00:02:12,200
the visualization of the decision tree
regression results will not be pretty.

42
00:02:12,366 --> 00:02:15,400
And that's because, as I told you
at the beginning of this section,

43
00:02:15,600 --> 00:02:19,033
the decision tree regression
model is clearly not the best model

44
00:02:19,033 --> 00:02:22,266
to use on a single feature data
set, right?

45
00:02:22,300 --> 00:02:26,933
It is more adapted to data sets with many
features, a high dimensional data set.

46
00:02:27,300 --> 00:02:31,200
And that's totally fine,
because the code we are implementing here

47
00:02:31,300 --> 00:02:35,300
can be very easily used on other data
sets with other features.

48
00:02:35,300 --> 00:02:38,133
That's what I explained
in the first tutorial of this section

49
00:02:38,133 --> 00:02:42,133
with you know that only 1 or 2 changes
to make in the data preprocessing phase,

50
00:02:42,366 --> 00:02:43,666
but I still want to show you

51
00:02:43,666 --> 00:02:47,400
the visualization results,
because we can only do this in 2D.

52
00:02:47,433 --> 00:02:50,033
You know,
that's why I chose this simple data set.

53
00:02:50,033 --> 00:02:52,233
It's in order to show you at the end

54
00:02:52,233 --> 00:02:56,066
what the regression curve looks like
for each of the regression models.

55
00:02:56,233 --> 00:02:59,333
And so we're going to still visualize that
for the decision tree regression model.

56
00:02:59,500 --> 00:03:02,733
But you will see that
it will be clearly not well adapted.

57
00:03:03,266 --> 00:03:03,766
All right.

58
00:03:03,766 --> 00:03:06,000
So congratulation for that prediction.

59
00:03:06,000 --> 00:03:09,900
And now in the final tutorial
of this section we will plot the decision

60
00:03:09,900 --> 00:03:13,833
tree regression curve in high resolution
to see what it looks like.

61
00:03:14,000 --> 00:03:15,866
And until then, enjoy machine learning.
