﻿1
00:00:00,200 --> 00:00:01,933
Let's see what prediction we get.

2
00:00:01,933 --> 00:00:05,533
Remember that this employee said
that its previous salary was 160 K.

3
00:00:05,933 --> 00:00:09,366
And now let's see what is a random forest
composed of ten trees?

4
00:00:09,700 --> 00:00:11,233
So let's execute that.

5
00:00:11,233 --> 00:00:15,566
And it says that the previous salary
was $141,000.

6
00:00:15,833 --> 00:00:19,700
That's actually a very dangerous
prediction because we are way below

7
00:00:19,700 --> 00:00:24,066
the 160 K salary that this new employee is
said to have in its previous company.

8
00:00:24,266 --> 00:00:27,533
So if we trust this prediction,
we would actually think this employee.

9
00:00:27,533 --> 00:00:28,533
He's bluffing.

10
00:00:28,533 --> 00:00:30,533
But no worries. We will not stop here.

11
00:00:30,533 --> 00:00:34,333
Right now we are going to try a random
forest with a lot more than ten trees.

12
00:00:34,700 --> 00:00:37,966
So let's pick for example, 100 trees
and let's see what we'll get.

13
00:00:37,966 --> 00:00:40,100
So I'm going to rebuild the model.

14
00:00:41,500 --> 00:00:42,366
Here we go.

15
00:00:42,366 --> 00:00:45,366
And now let's look at the graphic results.

16
00:00:45,866 --> 00:00:49,200
And as I was telling you
we don't get much more steps

17
00:00:49,566 --> 00:00:52,566
in this plot of our new random
forest regression.

18
00:00:52,766 --> 00:00:55,400
You know,
we multiplied our number of trees by ten,

19
00:00:55,400 --> 00:00:58,500
but the number of steps
was definitely not multiplied by ten.

20
00:00:58,733 --> 00:01:01,266
If we compare,
we can compare that very quickly.

21
00:01:01,266 --> 00:01:02,766
This is the previous plot.

22
00:01:02,766 --> 00:01:06,366
And this is a new 110 trees, 100 trees.

23
00:01:06,366 --> 00:01:08,866
We can see that
we have maybe a little more steps,

24
00:01:08,866 --> 00:01:11,533
but definitely not ten times
the previous steps.

25
00:01:11,533 --> 00:01:13,500
So the reason for this, the explanation

26
00:01:13,500 --> 00:01:17,133
is related to this convergence idea
that I talked to you about.

27
00:01:17,600 --> 00:01:20,833
And so what changes here with 100 trees
in terms of the plot

28
00:01:21,233 --> 00:01:24,000
is not the number of steps
there was increased,

29
00:01:24,000 --> 00:01:27,600
but a better choice,
a better location of the steps

30
00:01:27,600 --> 00:01:30,933
in the stairs
with respect to our salary axis.

31
00:01:30,933 --> 00:01:36,433
That means that maybe the steps are better
located to make our ultimate predictions

32
00:01:36,433 --> 00:01:41,400
of the salaries of each of our level
from 1 to 10 incremented by 0.1.

33
00:01:41,833 --> 00:01:45,300
So to check that out,
we simply need to make our

34
00:01:45,300 --> 00:01:49,033
final prediction
to predict the salary of this 6.5 level.

35
00:01:49,133 --> 00:01:52,266
So let's recap the employees saying 160 K

36
00:01:52,466 --> 00:01:56,100
a random forest with ten trees said 141 K.

37
00:01:56,400 --> 00:01:59,400
And now let's see what say a random forest
with 100 trees.

38
00:01:59,633 --> 00:02:00,866
Execute.

39
00:02:00,866 --> 00:02:03,533
And now it says 166 K.

40
00:02:03,533 --> 00:02:04,500
So much better.

41
00:02:04,500 --> 00:02:09,000
We're getting close to the suppose
real salary of 160 K.

42
00:02:09,000 --> 00:02:11,966
And besides we're now actually
on the good side of negotiation

43
00:02:11,966 --> 00:02:14,966
because we would no longer
think that this employee is bluffing.

44
00:02:15,400 --> 00:02:18,700
So since the prediction
seems to be improving as we increase

45
00:02:18,700 --> 00:02:22,300
the number of trees,
let's actually try with 500 trees.

46
00:02:22,700 --> 00:02:23,800
So that's a huge for us.

47
00:02:23,800 --> 00:02:24,433
We have now.

48
00:02:24,433 --> 00:02:29,066
So let's execute this
to build our new huge forest of 500 trees.

49
00:02:29,833 --> 00:02:32,200
Here we go. New forest created.

50
00:02:32,200 --> 00:02:35,200
Let's have a quick
look at the visualization plot results.

51
00:02:35,333 --> 00:02:36,700
But it's going to be the same thing.

52
00:02:36,700 --> 00:02:39,733
We will not get a lot of more stairs,
maybe a little more.

53
00:02:39,933 --> 00:02:41,133
Well, actually, let's check it out.

54
00:02:42,900 --> 00:02:44,200
Well definitely not.

55
00:02:44,200 --> 00:02:48,433
We seem to have the same number of steps
in the stairs, but as I was telling you,

56
00:02:48,433 --> 00:02:52,800
each of the steps in these stairs
might actually be better located to make

57
00:02:52,933 --> 00:02:56,933
each ultimate prediction of the salaries
for each of the ten levels here.

58
00:02:57,200 --> 00:03:01,066
So the best way to check that out
is actually to get

59
00:03:01,066 --> 00:03:04,566
our ultimate prediction
of the salary of this 6.5 level.

60
00:03:05,100 --> 00:03:06,600
And let's check it out.

61
00:03:06,600 --> 00:03:09,633
Let's see if we get a better prediction
than 166 K.

62
00:03:10,300 --> 00:03:11,466
Executing.

63
00:03:11,466 --> 00:03:17,633
And right in the spot,
we hit the bullseye with 160 458

64
00:03:17,633 --> 00:03:18,833
predicted salary.

65
00:03:18,833 --> 00:03:22,900
So awesome job that this random forest
with 500 trees just did here,

66
00:03:22,900 --> 00:03:27,033
because it predicted
almost the same salary as the supposed 160

67
00:03:27,033 --> 00:03:30,333
K salary that this future employee
set to have in its previous company.

68
00:03:30,800 --> 00:03:34,366
And actually, so far
before we made this random forest with 500

69
00:03:34,366 --> 00:03:37,366
trees, the best model
that made the closest prediction

70
00:03:37,433 --> 00:03:41,166
to this 160 K salary
was the polynomial regression model.

71
00:03:41,633 --> 00:03:45,166
And now the random forest regression
is beating the polynomial regression

72
00:03:45,166 --> 00:03:49,433
model, because now we get a prediction
that is almost the same as the real value.

73
00:03:49,900 --> 00:03:51,300
So right in the spot.

74
00:03:51,300 --> 00:03:52,733
Congratulations!

75
00:03:52,733 --> 00:03:55,200
We actually made our final model.

76
00:03:55,200 --> 00:03:59,066
And now we just want to conclude
this tutorial by making this transition

77
00:03:59,066 --> 00:04:02,800
to one of our future part,
which is actually part ten in part.

78
00:04:02,833 --> 00:04:06,000
And we will build some and simple machine
learning models,

79
00:04:06,000 --> 00:04:10,800
that is some models that are a combination
of several machine learning models.

80
00:04:11,100 --> 00:04:13,866
And you know, in machine learning
these are actually the best models.

81
00:04:13,866 --> 00:04:16,866
You know, when you have a team
of several machine learning models,

82
00:04:17,066 --> 00:04:18,833
they can actually make
an awesome prediction

83
00:04:18,833 --> 00:04:22,566
because unless we have a 19 machine
learning model in our combination of

84
00:04:22,566 --> 00:04:25,200
machine learning models,
that is the only model to be right.

85
00:04:25,200 --> 00:04:28,600
Well, you're more likely to get
the correct prediction with ten machine

86
00:04:28,600 --> 00:04:31,966
learning models predicting the same thing
than with just one model.

87
00:04:32,333 --> 00:04:33,933
So that's actually what we did here.

88
00:04:33,933 --> 00:04:38,300
Well, we had a team of same machine
learning models, which were decision tree

89
00:04:38,300 --> 00:04:39,333
regression models.

90
00:04:39,333 --> 00:04:43,166
But in the future we'll make a team
of different machine learning models.

91
00:04:43,500 --> 00:04:44,833
So that's going to be very fun.

92
00:04:44,833 --> 00:04:46,966
That's going to be very powerful as well.

93
00:04:46,966 --> 00:04:49,500
And I look forward
to getting there with you.

94
00:04:49,500 --> 00:04:52,200
So now I'm telling you congratulations
for two things.

95
00:04:52,200 --> 00:04:54,800
First,
for building this very powerful regression

96
00:04:54,800 --> 00:04:56,966
model, the random forest regression model.

97
00:04:56,966 --> 00:05:01,400
And second, for having built
all our regression models.

98
00:05:01,400 --> 00:05:05,433
We built some linear regression models,
some non-linear regression models,

99
00:05:05,600 --> 00:05:08,533
some nonlinear
non continuous regression models,

100
00:05:08,533 --> 00:05:12,533
and some nonlinear non
continuous and simple regression model.

101
00:05:12,833 --> 00:05:16,733
So congratulations you're definitely
on your way to becoming some experts

102
00:05:16,733 --> 00:05:17,800
in machine learning.

103
00:05:17,800 --> 00:05:19,966
But wait for what's coming next.

104
00:05:19,966 --> 00:05:22,700
So speaking of what's coming next
I look forward to seeing you

105
00:05:22,700 --> 00:05:24,766
in the next sections or next parts.

106
00:05:24,766 --> 00:05:26,466
And until then, enjoy machine learning.
