1
00:00:00,430 --> 00:00:04,180
We'll go back to the simple DNN that
we saw way back in week two for

2
00:00:04,180 --> 00:00:06,618
training on and we'll see what happens.

3
00:00:06,618 --> 00:00:11,559
We get a chart like this, which at
least to the eyeball looks really good,

4
00:00:11,559 --> 00:00:15,157
but it has a very large MAE so
something must be wrong.

5
00:00:15,157 --> 00:00:20,071
Indeed, if we zoom into the results we
can see in a little bit more detail about

6
00:00:20,071 --> 00:00:23,109
how the forecast behaves
in the original data.

7
00:00:23,109 --> 00:00:26,690
Our clue to the problem
could be our window size.

8
00:00:26,690 --> 00:00:28,700
Remember earlier we said it's a 20 so

9
00:00:28,700 --> 00:00:32,670
our training window sizes are 20
time slices worth of data.

10
00:00:32,670 --> 00:00:35,820
And given that each time
slice is a month in real time

11
00:00:35,820 --> 00:00:38,270
our window is a little under two years.

12
00:00:39,360 --> 00:00:40,950
But if you remember this chart,

13
00:00:40,950 --> 00:00:45,370
we can see that the seasonality of
sunspots is far greater than two years.

14
00:00:45,370 --> 00:00:47,262
It's closer to 11 years.

15
00:00:47,262 --> 00:00:51,634
And actually some science tells us that
it might even be 22 years with different

16
00:00:51,634 --> 00:00:53,833
cycles interleaguing with each other.

17
00:00:53,833 --> 00:00:58,179
So what would happen if we retrain
with a window size of 132,

18
00:00:58,179 --> 00:01:01,790
which is 11 years worth of
data as our window size.

19
00:01:03,060 --> 00:01:07,510
Now while this chart looks similar, we
can see from the MAE that it actually got

20
00:01:07,510 --> 00:01:11,320
worse so
increasing the window size didn't work.

21
00:01:11,320 --> 00:01:12,280
Why do you think that would be?

22
00:01:13,570 --> 00:01:17,630
Well, by looking back to the data,
we can realize that it is seasonal to

23
00:01:17,630 --> 00:01:22,530
about 11 years, but
we don't need a full season in our window.

24
00:01:22,530 --> 00:01:24,270
Zooming in on the data again,

25
00:01:24,270 --> 00:01:29,250
we'll see something like this where
it's just the typical time series.

26
00:01:29,250 --> 00:01:34,310
Values later on are somewhat related to
earlier ones, but that's a lot of noise.

27
00:01:34,310 --> 00:01:37,890
So maybe we don't need a huge
window of time in order to train.

28
00:01:37,890 --> 00:01:40,620
Maybe we should go with something
a little bit more like our initial 20,

29
00:01:40,620 --> 00:01:41,829
let's try 30.

30
00:01:43,590 --> 00:01:47,600
So if we look back at this code,
we can change our window size to 30.

31
00:01:47,600 --> 00:01:52,999
But then look at the split time, the data
set has around 3,500 items of data,

32
00:01:52,999 --> 00:01:56,689
but we're splitting it into training and
validation.

33
00:01:56,689 --> 00:02:03,080
Now 1,000, which means only 1,000 for
training and 2,500 for validation.

34
00:02:03,080 --> 00:02:04,462
That's a really bad split.

35
00:02:04,462 --> 00:02:06,431
There's not enough training data.

36
00:02:06,431 --> 00:02:09,860
So let's make it 3,500 instead.

37
00:02:09,860 --> 00:02:13,320
And then when we retrain, we'll get this.

38
00:02:13,320 --> 00:02:17,947
Our MAE has improved to 15 but
can we make it even better?

39
00:02:17,947 --> 00:02:21,491
Well, one thing we can try is to
edit the neural network design and

40
00:02:21,491 --> 00:02:22,786
height of parameters.

41
00:02:22,786 --> 00:02:25,540
If you remember, we had three
layers of 10, 10, and 1 neurons.

42
00:02:25,540 --> 00:02:29,840
Our input shape is now larger at 30.

43
00:02:29,840 --> 00:02:35,170
So maybe try different values here,
like 30, 15, and 1, and retrain.

44
00:02:36,410 --> 00:02:41,030
Surprisingly, this was a small step
backwards, with our MAE increasing.

45
00:02:42,120 --> 00:02:46,690
It also wasn't worth the extra compute
time for the extra neuron layers.

46
00:02:46,690 --> 00:02:50,570
So let's switch back to 10, 10, 1 and
instead look at the learning rate.

47
00:02:52,080 --> 00:02:52,920
Let's tweak it a little.

48
00:02:54,650 --> 00:02:59,270
Now after retraining, I can see my MAE
has decreased a bit which is good.