Data format
The required input format is a dataframe with at least the following columns:unique_idwith a unique identifier for each time seriedswith the datestamp and a columnywith the values of theserie
TimeSeries.fit
| unique_id | ds | y | static_0 | static_1 | |
|---|---|---|---|---|---|
| 0 | id_00 | 2000-01-01 | 7.404529 | 27 | 53 |
| 1 | id_00 | 2000-01-02 | 35.952624 | 27 | 53 |
| 2 | id_00 | 2000-01-03 | 68.958353 | 27 | 53 |
| 3 | id_00 | 2000-01-04 | 84.994505 | 27 | 53 |
| 4 | id_00 | 2000-01-05 | 113.219810 | 27 | 53 |
| … | … | … | … | … | … |
| 4869 | id_19 | 2000-03-25 | 400.606807 | 97 | 45 |
| 4870 | id_19 | 2000-03-26 | 538.794824 | 97 | 45 |
| 4871 | id_19 | 2000-03-27 | 620.202104 | 97 | 45 |
| 4872 | id_19 | 2000-03-28 | 20.625426 | 97 | 45 |
| 4873 | id_19 | 2000-03-29 | 141.513169 | 97 | 45 |
| unique_id | ds | y | static_0 | static_1 | |
|---|---|---|---|---|---|
| 0 | id_00 | 2000-01-01 | 7.404529 | 27 | 53 |
| 1 | id_00 | 2000-01-02 | 35.952624 | 27 | 53 |
| 2 | id_00 | 2000-01-03 | 68.958353 | 27 | 53 |
| 3 | id_00 | 2000-01-04 | 84.994505 | 27 | 53 |
| 4 | id_00 | 2000-01-05 | 113.219810 | 27 | 53 |
| … | … | … | … | … | … |
| 217 | id_00 | 2000-08-05 | 13.263188 | 27 | 53 |
| 218 | id_00 | 2000-08-06 | 38.231981 | 27 | 53 |
| 219 | id_00 | 2000-08-07 | 59.555183 | 27 | 53 |
| 220 | id_00 | 2000-08-08 | 86.986368 | 27 | 53 |
| 221 | id_00 | 2000-08-09 | 119.254810 | 27 | 53 |
TimeSeries
TimeSeries.fit_transform
data and save the required information for the predictions step.
If not all features are static, specify which ones are in static_features.
If you don’t want to drop rows with null values after the transformations set dropna=False
If keep_last_n is not None then that number of observations is kept across all series for updates.
TimeSeries.predict
TimeSeries.update
build_transform_name and the
value is a tuple where the first element is the lag it is applied to,
then the function and then the function arguments.
lags we define the transformation as the identity
function applied to its corresponding lag. This is because
_transform_series
takes the lag as an argument and shifts the array before computing the
transformation.
ga. If
the data type of the series values is an int then it is converted to
np.float32, this is because lags generate np.nans so we need a float
data type for them.
uids attribute.
y and ds columns are taken
as static features.
static_features to
TimeSeries.fit_transform
then only these are kept.
TimeSeries.fit_transform
requires that the y column doesn’t have any null values. This is
because the transformations could propagate them forward, so if you have
null values in the y column you’ll get an error.
TimeSeries.predict
passing the model and the horizon to get the predictions back.
X_df.

