All the courses
Course information
Sequence models: focus on time series (there are others) — stock, weather,...
At the end, we wanna model sunspot actitivity cycles which is important to NASA and other space agencies.
Using RNN on time series data.
📙 Notebook: introduction to time series. + explaining video. → How to create synthetic time series data + plot them.
Trend: a specific direcion that they're moving in.
Seasonality: patterns repeat at predictable intervals (eg. active users for a website).
Combinition of both trend and seasonality.
Stationary TS
Autocorrelated TS: a time series is linearly related to a lagged version of itself.. There is no trend, no seasonality.
Multiple auto correlation.
May be trend + seasonality + autorrelation + noise.
Non-stationary TS In this case, we base just on the later data to predict the future (not on the whole data).
Fixed partitioning (this course focuses on) = splitting TS data into training period, validation period and test period.
We can split + train + test to get a model and then re-train with the data containing also the test period so that the model is optimized! In that case, the test set comes from the future.
Roll-forward partitioning: we start with a short training period and we gradually increase it (1 day at a time or 1 week at a time). At each iteration, we train the model on training period, use it to focast the following day/week in the validation period. = Fixed partitioning in a number of times!
For evaluating models:
errors = forecasts - actual
# Mean squared error (square to get rid of negative values)
# Eg. Used if large errors are potentially dangerous
mse = np.square(errors).mean()
# Get back to the same scale to error
rmse = np.sqrt(mse)
# Mean absolute error (his favorite)
# this doesn't penalize large errs as much as mse does,
# used if loss is proportional to the size of err
mae = np.abs(errors).mean()
# Mean abs percentage err
# idea of the size of err compared to the values
mape = np.abs(errors / x_valid).mean()
# MAE with TF
keras.metrics.mean_absolute_error(x_valid, naive_forecast).numpy()