Univariant Timeseries Forecasting
Motivation: A little Browser Playground for using LSTM layers.
Sources:
TF Timeseries Tutorial
and
TF MaunaLoa CO2
Training Data
Generate
with n =
Load Data
[optional] Only take last
timesteps from
Normalized Input Data
Clip to min=
max=
Stride Timeseries
(n) Train / Test Split ( of n)
(w) History Window
(f) Forecast Steps
dim x = [n - (w - 1), w]
Train Data:
Test Data:
Preview of Timeseries X and Target Value Y (Test Dataset):
Preview Index: 0
Create Tensor's and Shuffle Data
Note: Add new Dimension of shape from [n, m] to [n, m, 1]
Shuffle Data
Create Network
{ "layer_1": { "type": "lstm", "opts": {"units": 128, "activation":"relu", "returnSequences": true, "recurrentInitializer": "randomNormal"} }, "layer_2": { "type": "lstm", "opts": {"units": 64, "activation":"tanh", "recurrentActivation": "sigmoid", "recurrentInitializer": "randomNormal"} } }
Train Model
Hyperparameter Settings:
{ "train": { "optimizer": "adam", "learning_rate": 0.01, "loss": "meanSquaredError" }, "fit": { "batchSize": 32, "validationSplit": 0.20, "epochs": 40 } }
Test Accurracy
Test Model on unseen data (Train/Test Split):
Test Data Index: 0
Forecast
on the overall CO2 Data.
Continue Forecasting on predicted data: Timespan +1