1
00:00:00,960 --> 00:00:05,940
In this video, we will learn how to create or toad aggression more than in Python.

2
00:00:07,260 --> 00:00:10,240
In the last lecture, we have created my forecast model.

3
00:00:11,180 --> 00:00:16,870
We'll also compare the performance of forward auto regression modern with the night forecast model.

4
00:00:18,040 --> 00:00:24,910
So let's import the same dataset that is daily minimum temperature data say we are storing this data,

5
00:00:24,910 --> 00:00:26,800
certain raw data from Quadri beef.

6
00:00:28,360 --> 00:00:31,350
Now let's debate our data stream and to test and train.

7
00:00:34,500 --> 00:00:41,330
We will be selecting last seven venues as our test venues and the remaining values as the screen value.

8
00:00:41,910 --> 00:00:44,310
So let's run this also.

9
00:00:46,320 --> 00:00:48,560
Let's look at the first five venues.

10
00:00:48,590 --> 00:00:49,620
Overtrained did say.

11
00:00:52,110 --> 00:00:52,320
No.

12
00:00:52,740 --> 00:00:56,940
Or do regression model is available in a sex model library.

13
00:00:58,630 --> 00:01:04,750
So we will import air from a sex model, not TSA, not air underscored modern.

14
00:01:08,850 --> 00:01:17,220
And first, we are creating what here object and then we are fighting it, using don't fit my.

15
00:01:18,690 --> 00:01:22,920
So our object name is model and we are calling here.

16
00:01:23,490 --> 00:01:27,660
And then as an argument, we are pointing out trying to say that this screen.

17
00:01:30,390 --> 00:01:33,500
Then we had fitting this model using don't fit my coat.

18
00:01:36,390 --> 00:01:36,660
No.

19
00:01:37,130 --> 00:01:42,920
You know, that on television means regression on the leg values.

20
00:01:43,850 --> 00:01:49,340
So now let's see how many leg values are coming out to be important in our model

21
00:01:52,190 --> 00:02:01,430
to see that we can just use North Gay underscored air, a tribute of for fitted model object.

22
00:02:02,010 --> 00:02:03,890
So will rate model underscore fit.

23
00:02:04,010 --> 00:02:05,030
This is our object.

24
00:02:06,330 --> 00:02:07,480
And then we can right.

25
00:02:07,590 --> 00:02:09,520
Don't get underscored here.

26
00:02:09,840 --> 00:02:17,430
This day tribute of this object, if you run this, you can see that we are getting.

27
00:02:18,720 --> 00:02:19,970
Output is 29.

28
00:02:20,170 --> 00:02:26,080
This means that we are considering 29 lag variables for what model?

29
00:02:29,940 --> 00:02:34,640
Now, let's see the coefficient of this 29 variables.

30
00:02:35,400 --> 00:02:39,480
We can access the coefficient from not badam attribute.

31
00:02:39,870 --> 00:02:47,700
So if we just state model lenders fit thought pattern and execute it, we'll get the coefficient of

32
00:02:47,790 --> 00:02:51,900
all this twenty nine leg variables coefficient.

33
00:02:52,920 --> 00:02:55,080
So first we have the Constanten.

34
00:02:58,010 --> 00:03:04,400
Then we have the coefficient of legman, values like to allu and so on.

35
00:03:04,950 --> 00:03:07,390
Builder Twenty 29 leg value.

36
00:03:09,050 --> 00:03:12,260
The third leg very well sort not important in our model.

37
00:03:12,980 --> 00:03:17,910
And only this 29 like variables are important for this model.

38
00:03:21,090 --> 00:03:31,560
So now if you have values of last 29 timeframe, you can predict the future value using this coefficients

39
00:03:31,800 --> 00:03:35,730
and the consent to that we are getting in this result.

40
00:03:39,570 --> 00:03:44,310
The other way to predict future values is to radically use dort predict function.

41
00:03:45,660 --> 00:03:49,270
So we can model, underscore fact, not predict.

42
00:03:49,770 --> 00:03:58,560
And here we have to give the start and the end of the period for which we won the predictions.

43
00:04:00,420 --> 00:04:03,470
So here we have one prediction on our test set.

44
00:04:04,650 --> 00:04:07,130
So what a start is the length of green.

45
00:04:08,220 --> 00:04:13,740
So suppose we are hundred records in the train and 20 records in test.

46
00:04:14,790 --> 00:04:23,260
And in that case, if we won the prediction on test data, we won prediction from index number hundred.

47
00:04:23,330 --> 00:04:24,540
Two hundred and twenty.

48
00:04:26,160 --> 00:04:34,440
So this the same case, Len, of Cream will give us the land of the green dataset.

49
00:04:34,560 --> 00:04:38,070
So if we have a hundred variables in our train dataset.

50
00:04:38,260 --> 00:04:41,160
Land of Green will give us hundred as an output.

51
00:04:41,760 --> 00:04:42,180
So what?

52
00:04:42,210 --> 00:04:44,410
Assad will automatically become Andre.

53
00:04:46,560 --> 00:04:49,890
And for the end, we have to write the end point of the prediction.

54
00:04:50,460 --> 00:04:54,300
So again, we have hundred records and train 20 records in test.

55
00:04:54,810 --> 00:04:57,900
So we want prediction from hundred to 120.

56
00:04:58,560 --> 00:05:00,120
So that's why we are writing.

57
00:05:00,240 --> 00:05:01,350
Length of green.

58
00:05:01,800 --> 00:05:05,240
So this will give us suppose Henry Lantau test.

59
00:05:05,310 --> 00:05:09,160
This will give us friendly and minus one because these are index.

60
00:05:09,240 --> 00:05:15,050
So we want all the values from a hundred to 110 19th index.

61
00:05:15,110 --> 00:05:17,360
So there are in total 20 values.

62
00:05:19,080 --> 00:05:21,040
A hundred was just an example.

63
00:05:21,210 --> 00:05:24,810
Here we are selecting Lentil Crane and then.

64
00:05:25,260 --> 00:05:27,900
And this also determined by the length of print.

65
00:05:28,050 --> 00:05:28,620
And test.

66
00:05:30,600 --> 00:05:34,200
So if we just stand this, we are restoring this data.

67
00:05:34,260 --> 00:05:41,310
And to add another variable called prediction, we just look at the values that are present in this

68
00:05:41,310 --> 00:05:41,880
prediction.

69
00:05:43,500 --> 00:05:50,490
So you can see what testator was of seven records.

70
00:05:50,850 --> 00:05:52,950
That's why we are getting seven values here.

71
00:05:53,460 --> 00:05:55,000
And this Saturday in Texas.

72
00:05:55,710 --> 00:06:01,620
So this must be the length of work and they decide three, six, four, three.

73
00:06:03,810 --> 00:06:05,920
So these are the prayer to tell of our lives.

74
00:06:06,240 --> 00:06:13,680
If we just want to look at the first value, that is the first forecasted value we can use.

75
00:06:14,640 --> 00:06:15,080
I lost.

76
00:06:18,090 --> 00:06:22,350
You can see to get the venue in your suits prediction, but I.

77
00:06:22,830 --> 00:06:24,670
And the Xeloda index.

78
00:06:26,550 --> 00:06:32,620
So usually for the first argument, we just straight square record zero.

79
00:06:33,570 --> 00:06:36,670
But here, the indexes are not starting from zero.

80
00:06:36,930 --> 00:06:42,120
Here the indexes are starting from three six four three two three six four nine.

81
00:06:42,540 --> 00:06:49,430
That's why we have to use a lock instead of just let it clear, I think predictions and then square

82
00:06:49,460 --> 00:06:50,040
reconcile.

83
00:06:51,750 --> 00:06:59,340
So since indexes are not starting from zero, we have to write like this to grab the first value for

84
00:06:59,340 --> 00:06:59,870
the second one.

85
00:06:59,870 --> 00:07:00,990
When do we have to write?

86
00:07:02,040 --> 00:07:02,530
I know.

87
00:07:03,420 --> 00:07:05,010
You can see we are getting the second.

88
00:07:10,170 --> 00:07:14,390
Now let's calculate the masc value for our private data.

89
00:07:15,910 --> 00:07:20,100
Again, we will use meaning squared error function from Eskil and not Matrix.

90
00:07:21,850 --> 00:07:24,040
And here we have to throw it to a loose.

91
00:07:24,970 --> 00:07:26,490
Our actual values of.

92
00:07:27,490 --> 00:07:29,440
And then the predicted values of way.

93
00:07:29,650 --> 00:07:32,400
So what actual values that is stored in Ascender Square.

94
00:07:33,550 --> 00:07:36,760
And the predicted values are restored in predictions.

95
00:07:38,500 --> 00:07:39,520
So just.

96
00:07:40,980 --> 00:07:49,380
Slurping And I see here you can see that the MASC for this model is one point five if you compare with

97
00:07:49,650 --> 00:07:51,150
a knife.

98
00:07:51,180 --> 00:07:51,540
More than.

99
00:07:54,020 --> 00:07:56,220
Hear them and message when he was three point four.

100
00:07:57,040 --> 00:08:02,130
So our error is decreasing from three point four to one point five.

101
00:08:02,160 --> 00:08:03,690
By using a more than.

102
00:08:06,970 --> 00:08:12,450
So you can say that the twin cities that we are using is not a random walk.

103
00:08:12,610 --> 00:08:18,760
There is some information stored in that time cities and we are restricting that information, using

104
00:08:19,430 --> 00:08:26,530
your model and reducing the MSE from three point four to one point five.

105
00:08:30,720 --> 00:08:36,270
Now, again, we can also applaud the predicted values and actual values on the plot.

106
00:08:39,430 --> 00:08:41,600
We'll be just using by plot or plot.

107
00:08:42,000 --> 00:08:49,660
First, we are plotting to why and then we are plotting predictions with a lot of people to we run this

108
00:08:51,400 --> 00:08:53,200
this new are the actual values.

109
00:08:53,710 --> 00:08:58,270
And the red line is the predicted values for this seven days.

110
00:09:00,580 --> 00:09:03,040
So that's all for this video.

111
00:09:03,250 --> 00:09:05,730
This is how we create our model in Python.

112
00:09:06,040 --> 00:09:11,050
We use, said Smardon Liberty to basically create a model.

113
00:09:11,830 --> 00:09:19,020
And in the next lecture, we will discuss how to use walk forward validation for each other.

114
00:09:20,440 --> 00:09:22,200
That's all for this lecture.

115
00:09:22,240 --> 00:09:22,680
Thank you.
