Skip to main content

PrepareSeriesUnit

Unit
DashAI.back.units.PrepareSeriesUnit

Turn a dataset into a series on its grid, and cut it into origins.

The task validates the roles, orders the rows by time and checks the series sits on a regular grid (SingleSeriesForecastingTask.prepare_series). What comes out is the series' values in time order, which is all a forecaster reads, and the grid, which turns a step back into a date.

The splitter then cuts the series into backtest origins. The cuts are steps, and they are published as split_indexes: the job stores them on the run as it stores a holdout's rows, and the splitter's class is what reads either.

The rows come out too, as dataset, in the same date order: the exogenous variables are columns of those rows, and ApplyCutPreprocessingUnit reads them from there, one step per row. Nothing here applies the session's preprocessing. With preprocessing, the job hands this unit only the time index as an input, since the exogenous columns the model reads exist only once each cut's fit has run.

The sibling for the x/y tasks is PrepareAndSplitUnit. A series is not an x and a y, and a backtest's cuts are not partitions of rows, so this publishes different keys.

Parameters​

task_name : string, default=TabularClassificationTask
Name of the task the dataset is prepared for.
input_columns : array, default=[]
Names of the columns used as model input.
output_columns : array, default=[]
Names of the columns the model has to predict.
splitter : object
Splitter that cuts the series into backtest origins, in steps.

Methods​

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

Defined on PrepareSeriesUnit

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.