1
00:00:02,780 --> 00:00:07,450
Hey, guys, now let's see how to do the forecasting, the altitude model in Python.

2
00:00:07,990 --> 00:00:08,590
All right.

3
00:00:08,600 --> 00:00:13,760
In the previous lecture, we talk about the simple linear regression and this is what the output which

4
00:00:13,760 --> 00:00:14,270
we got.

5
00:00:14,720 --> 00:00:20,180
And if at all, you can see this is what the output and Peter want is simple, linear.

6
00:00:20,180 --> 00:00:23,650
And also the forecast is also just extension of this line.

7
00:00:24,080 --> 00:00:31,970
And whatever the feeling part, you can see, this part is basically the confidence interval or margin

8
00:00:31,970 --> 00:00:32,390
of error.

9
00:00:33,110 --> 00:00:36,280
Now, let's go back like let's see how to build a.

10
00:00:37,130 --> 00:00:39,600
So this is what the data we're interested in.

11
00:00:39,890 --> 00:00:43,130
So what we will do will take the strain data on that as data.

12
00:00:43,460 --> 00:00:45,650
We already use this with that.

13
00:00:45,890 --> 00:00:52,270
And we will take this train data and the data and for this train data and put the stats data, we will

14
00:00:52,280 --> 00:00:56,100
take the regression or attitude modeling for this.

15
00:00:56,530 --> 00:00:56,930
All right.

16
00:00:57,050 --> 00:00:58,230
So let's get ready.

17
00:00:58,250 --> 00:01:02,320
So click on this text and type the attitude model.

18
00:01:03,740 --> 00:01:07,970
How did you model is basically adding up the seasonalities.

19
00:01:07,970 --> 00:01:09,470
You're just adding up the seasonality.

20
00:01:10,220 --> 00:01:12,920
So let's take this leg up on the train data.

21
00:01:14,300 --> 00:01:16,060
So this is the train.

22
00:01:16,070 --> 00:01:20,600
So we have the train data and we have already the data as we preprocessed.

23
00:01:20,960 --> 00:01:22,490
We've already taken up the time.

24
00:01:22,490 --> 00:01:24,410
We already taken up the month.

25
00:01:24,680 --> 00:01:27,720
We already got the time as well as the month.

26
00:01:28,070 --> 00:01:34,150
So what we need to do here is that we need to create the dummy for this and they've done this.

27
00:01:34,160 --> 00:01:35,180
We need to extract it.

28
00:01:35,540 --> 00:01:42,470
So before that, let's start with the basic visualization so that you can understand much better how

29
00:01:42,470 --> 00:01:46,310
exactly that can all be able to calculate the seasonality here.

30
00:01:47,270 --> 00:01:47,700
All right.

31
00:01:47,930 --> 00:01:51,680
So first step, what we do is that we will draw the scatterplot.

32
00:01:52,430 --> 00:01:58,230
We will draw the scatter drawn between the idea of the school train.

33
00:01:58,610 --> 00:02:00,020
This is my training data.

34
00:02:00,410 --> 00:02:06,200
And I would take the time component is what makes access or so.

35
00:02:07,010 --> 00:02:12,580
And we can take one more thing for both of sales.

36
00:02:13,070 --> 00:02:19,160
So this is basically the scatterplot, which looks like, all right, we got some error.

37
00:02:21,770 --> 00:02:23,150
Yeah, so property.

38
00:02:25,470 --> 00:02:28,380
X and Y, this is the first code train.

39
00:02:29,130 --> 00:02:36,750
All right, so it's a slow train and this is how it looks like, OK, basically like, you know, and

40
00:02:36,930 --> 00:02:39,740
you can take the block.

41
00:02:39,750 --> 00:02:46,700
And if you take the same values on the X axis, these the school year and years on this.

42
00:02:46,710 --> 00:02:56,490
And if you want the blue lines and this is how you get in, so I'll go with the dotted lines.

43
00:02:56,790 --> 00:02:58,020
That will be nice for me.

44
00:02:58,320 --> 00:03:00,930
So this is a just joining of each and every point.

45
00:03:00,960 --> 00:03:02,700
This is how it looks for me.

46
00:03:03,210 --> 00:03:03,540
All right.

47
00:03:03,570 --> 00:03:09,830
Let me increase up the size of being able to go and pick size.

48
00:03:10,320 --> 00:03:12,900
And I take this to the standard 15 to eight.

49
00:03:13,360 --> 00:03:16,030
So this is the way to look at the big block now.

50
00:03:16,080 --> 00:03:17,680
So this is quite true.

51
00:03:18,630 --> 00:03:19,030
All right.

52
00:03:19,050 --> 00:03:23,050
So what I will do now is that let me color it.

53
00:03:23,250 --> 00:03:26,330
So what I'll do instead of being the only the scatterplot, the plane.

54
00:03:26,610 --> 00:03:27,600
So what I'll do.

55
00:03:27,630 --> 00:03:32,230
Let me color according to the month.

56
00:03:32,250 --> 00:03:35,280
Let me color according to the Moniz's, according to the MONDLI.

57
00:03:35,760 --> 00:03:41,040
So to do that I can use the seabourne dot scatterplot.

58
00:03:41,940 --> 00:03:44,270
So we have the bond brought there.

59
00:03:44,280 --> 00:03:50,430
So you have access on the train of EOS or.

60
00:03:51,750 --> 00:03:52,170
All right.

61
00:03:52,170 --> 00:03:55,020
I can take it like it is.

62
00:03:55,020 --> 00:04:06,690
X axis and y axis is sales and the data is equal to the from the school train.

63
00:04:07,050 --> 00:04:14,720
So if I see that the scatterplot and this is how this guy got all right.

64
00:04:14,730 --> 00:04:22,260
So and I can still increase the size X is equal to something like three hundred, I can increase the

65
00:04:22,260 --> 00:04:25,110
size of my silicones like Bego Cycos.

66
00:04:25,110 --> 00:04:31,200
I can get with this and medium level up so I can get to Endre.

67
00:04:31,620 --> 00:04:36,950
And so this is, this is, this is what I can get is what I can really get from this.

68
00:04:37,320 --> 00:04:44,640
So what I can do, I will, I will basically color with you is basically the coloring font and you can

69
00:04:44,640 --> 00:04:46,500
color this using the.

70
00:04:52,600 --> 00:04:53,540
Month them.

71
00:04:53,560 --> 00:04:58,790
So this is the month name I can use this month, name and color recording.

72
00:04:59,510 --> 00:04:59,890
Yes.

73
00:05:00,190 --> 00:05:02,360
Now you can see we have the coloring.

74
00:05:02,870 --> 00:05:08,320
This is the January, February, March, April, May, June, July, August.

75
00:05:08,680 --> 00:05:11,640
And you can see the plot is being repeated.

76
00:05:11,640 --> 00:05:20,260
The plot has been repeated and it's clearly visible, like how exactly the data has been changing.

77
00:05:20,500 --> 00:05:23,100
So according to the colors, we have it later.

78
00:05:23,320 --> 00:05:29,440
And if at all you want this month name you could all on this month name to be displayed.

79
00:05:29,740 --> 00:05:37,060
And we can also do that using the power to text be able to detect is an excellent way of doing that.

80
00:05:37,330 --> 00:05:45,160
What you do what we need to do here is that we need to give the exposition and we need to give the Y

81
00:05:45,160 --> 00:05:50,070
position and the text and we need to do the Y position.

82
00:05:50,080 --> 00:05:52,540
And finally, we need to do the text here.

83
00:05:52,990 --> 00:05:53,980
So this is the text.

84
00:05:54,060 --> 00:06:01,830
So the deal follows train and it's a month we can get it, but we have to do the step by step if we're

85
00:06:01,900 --> 00:06:03,280
not put on the spot.

86
00:06:03,310 --> 00:06:10,420
So what I'll do for I in range or for I in range of.

87
00:06:11,520 --> 00:06:16,360
You can take it from Lentol Daftness Catrine.

88
00:06:16,770 --> 00:06:24,390
So this is where to put all these values, I can iterate this and for each and every part I'll take

89
00:06:24,390 --> 00:06:25,100
it to I.

90
00:06:25,410 --> 00:06:26,910
And this is also I.

91
00:06:27,750 --> 00:06:31,680
This is also I and this is also my eye.

92
00:06:31,920 --> 00:06:34,090
So you can get all the violencia.

93
00:06:34,380 --> 00:06:42,400
So what I mean to underscore, for example, predict like zero you'll get the zero to value.

94
00:06:42,420 --> 00:06:45,410
So this is the zero is nothing like a two thousand.

95
00:06:45,440 --> 00:06:52,260
And so those information you can get if at all, you want the month of detail, you will get the January

96
00:06:52,560 --> 00:06:56,980
and February one and so on.

97
00:06:57,360 --> 00:07:00,570
So they can do like an excellent way to execute that.

98
00:07:01,140 --> 00:07:07,190
And you can see that, you know, this is a January, February, March and May, June, July.

99
00:07:07,200 --> 00:07:13,470
And you can easily plant it and you can see the behavior, how exactly the data has been there.

100
00:07:13,470 --> 00:07:14,470
And you can see that.

101
00:07:14,880 --> 00:07:15,340
All right.

102
00:07:15,360 --> 00:07:17,130
So we can also do one more thing.

103
00:07:17,280 --> 00:07:18,690
That is a one special.

104
00:07:18,690 --> 00:07:22,640
May I use it for, like, you know, setting up these options?

105
00:07:22,650 --> 00:07:25,140
It is like coloring.

106
00:07:25,260 --> 00:07:27,480
I use this this time on the set.

107
00:07:27,490 --> 00:07:29,730
And one is also the color map.

108
00:07:30,120 --> 00:07:34,560
This is nice color map where we can segregated, sort of like the rainbow colors.

109
00:07:34,890 --> 00:07:39,330
It's a solid line, solid color to each and every month.

110
00:07:39,340 --> 00:07:41,340
It's really the coolest part.

111
00:07:42,030 --> 00:07:43,860
But the problem is that you like.

112
00:07:44,370 --> 00:07:46,230
But it's OK then it is.

113
00:07:46,560 --> 00:07:52,170
The color is being repeated but still we can understand much better visualization than the previous

114
00:07:52,170 --> 00:07:52,440
one.

115
00:07:53,040 --> 00:07:58,080
But anyway, but one thing we can see is that we can see the seasonality part here is 12.

116
00:07:58,320 --> 00:08:04,180
So roughly, roughly every year that's the cycle has been repeated and roughly making up like every

117
00:08:04,180 --> 00:08:06,600
year the cycle has been repeated.

118
00:08:06,960 --> 00:08:15,510
So in this case, my seasonality is to OK, so now the season from this observations are right on seasonalities

119
00:08:15,540 --> 00:08:16,110
to all.

120
00:08:19,080 --> 00:08:20,470
Seasonalities, Twala.

121
00:08:20,730 --> 00:08:33,870
And we need to create, create and minus one dumbness, so which is basically 11 double's 11 columns.

122
00:08:34,220 --> 00:08:38,350
OK, so I need to create 11 columns here.

