DateFeaturesConverter
Break a Date column into the calendar numbers hidden inside it.
A date is stored as text and a format, which no model can read. What a
forecast needs from it is calendar position: which month, which weekday,
which week of the year. This converter writes those out as integer
columns named <column>_<feature>, one set per Date column in
scope, and leaves the original column untouched.
The columns it produces are what the exogenous role of
SingleSeriesForecastingTask takes beside the series: variables known
for every period being forecast, since a calendar is known in advance.
The role takes only variables like those, known ahead of time; a price
goes in only once it has been set for the periods being forecast. The
time index itself is protected from the session's preprocessing, so the
calendar comes from a copy of the date in a column of its own.
Cyclical encoding answers the one problem plain calendar numbers have.
Month 12 and month 1 are one step apart in the calendar and eleven apart
as integers, so a model reading the integer treats the year end as the
furthest point from the year start. Encoding a periodic feature of period
p as sin(2*pi*v/p) and cos(2*pi*v/p) puts consecutive values
next to each other on a circle, which is where they belong.