deep-learning-with-R-2nd-edition-code icon indicating copy to clipboard operation
deep-learning-with-R-2nd-edition-code copied to clipboard

The data preparation question

Open ggeeoorrgg opened this issue 2 years ago • 0 comments

As stated in the book's Chapter 10 "...The exact formulation of the problem will be as follows: given data covering the previous five days and sampled once per hour, can we predict the temperature in 24 hours?.." With this in mind do we really need to subtract 1 in : delay <- sampling_rate * (sequence_length + 24 - 1)? (see row #108 Ch 10). I know, this code matches the book. But for this delay the 1st sample:

> full_df$`Date Time`[1]
[1] "2009-01-01 00:10:00 -01"

has such target:

> head(tail(full_df$`Date Time`, -delay),1)
[1] "2009-01-06 23:10:00 -01"

It is not exactly 24 hours for a prediction horizon. Without subtracting 1 things seem to look better:

delay <- sampling_rate * (sequence_length + 24)
head(tail(full_df$`Date Time`, -delay),1)
[1] "2009-01-07 00:10:00 -01"

So i can`t figure out the reason for subtracting of 1. Any thoughts?

ggeeoorrgg avatar Apr 27 '23 12:04 ggeeoorrgg