The prediction from DNN in lab 2 seems to shifted to the right, compared to the actual data. Any explanation for this? can this be corrected?
model_forecast
is done only for validation data. This is why you see the shift in inputs to the model. Take what is required to predict from split_time
till end of series.
To make a prediction for timestep 3000, the model takes as input, data from timestep 2970 upto and including timestep 2999.
Hi Balaji, thanks for your reply. That is right, the prediction is done for the validation data.
If I left shift the prediction data by 1, the MAE dropped from 14 to about 8, which is very significant. I felt like that there is a shift somewhere during the data processing.
You’re welcome.
When you shift predictions one step to the left, what’s the prediction for the last timestep? IMO, it’s best not to fiddle with the predicted values at the cost of losing a timestep. Instead, tune the model for better results.
Here’s one way to look at elements in your dataset and see if the batching meets your expectations:
batch = next(iter(train_set.take(1)))
xs, ys = batch
print(xs[0])
print(ys[0])