Temporal embedding
In Chapter 5, Time Series Forecasting as Regression, we briefly discussed temporal embedding as a process where we try to embed time into features that an ML model can leverage. If we think about time for a second, we can see that two aspects of time are important to us in the context of time series forecasting—the passage of time and the periodicity of time.
There are a few features that we can add to help us capture these aspects in an ML model:
- Calendar features
- Time elapsed
- Fourier terms
Let’s look at each of them.
Calendar features
The first set of features that we can extract are features based on calendars. Although the strict definition of time series is a set of observations taken sequentially in time, more often than not, we will have the timestamps of these collected observations alongside the time series. We can utilize these timestamps and extract calendar features, such as the month, quarter...