Skip to main content

ForecastHorizonUnit

Unit
DashAI.back.units.ForecastHorizonUnit

Forecast the steps after a trained series, and name their dates.

The kept model of a forecasting run was fitted on the whole series and carries its grid (time_grid): the frequency and the last date are what turn the forecast's steps into dates. The dates come out as the time index column the session named, in the format the training dataset declared it with, so the rows look like the training rows.

Publishes them as dataset, the rows a prediction is made for, and the forecast as y_pred: SavePredictionUnit writes the two side by side as it writes any prediction. Nothing is read from a dataset to predict on, because there is none: a forecast reaches past the end of the data (RECONCILING_FORECASTING §2.13, D6).

Parameters​

horizon : integer, default=6
How many steps ahead the model is scored, from every origin and on the test. A step is one period of the series: a month on a monthly series.
input_columns : array, default=[]
Names of the columns used as model input.

Methods​

execute(self, ctx: DashAI.back.units.context.ExecutionContext) -> None

Defined on ForecastHorizonUnit

Do the unit's work, reading from and writing to the context.

Parameters

ctx : ExecutionContext
The shared execution context.

get_credential(self, name: str)

Defined on ConfigObject

Resolve a registered credential component by name.

Parameters

name : str
Credential component class name (e.g. "HuggingFaceCredential").

Returns

BaseCredential
An instance of the requested credential component.

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

validate(self, ctx: DashAI.back.units.context.ExecutionContext) -> None

Defined on BaseUnit

Check preconditions without executing the unit.

Parameters

ctx : ExecutionContext
The shared execution context.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.