PrepareFutureUnit
Check the rows a user brings for the steps after the series.
A run that read exogenous variables forecasts with their future values,
so the rows to predict are those values (RECONCILING_FORECASTING §2.14,
decisions 5 and 6). Read from a dataset or typed by hand, they arrive as
the same dataset, and are checked here once:
- they are put in date order, as the training series was (D5);
- their dates have to be exactly the next steps of the kept model's grid, as many as there are rows: that number is the horizon. A date repeated, off the grid or skipping a step is refused, naming it;
- every column the run read is there, of the type the run read it as
(
Run.exogenous.columns), and has a value on every row: a number that is not finite is refused like a gap, naming the column and dates.
What comes out, as dataset again, is the date and those columns only.
The series, if it came along, and any other column are left out, as an
x/y prediction ignores the columns its model does not read.
Parameters
- time_index : string, default=
- The time index column, which dates every future row.
- exogenous_columns : array, default=
[] - The columns the future rows have to bring, as the run recorded them: {'name': ..., 'type': ...} for each raw column the run read its exogenous variables from.
Methods
execute(self, ctx: DashAI.back.units.context.ExecutionContext) -> None
PrepareFutureUnitDo the unit's work, reading from and writing to the context.
Parameters
- ctx : ExecutionContext
- The shared execution context.
get_credential(self, name: str)
ConfigObjectResolve 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
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
validate(self, ctx: DashAI.back.units.context.ExecutionContext) -> None
BaseUnitCheck preconditions without executing the unit.
Parameters
- ctx : ExecutionContext
- The shared execution context.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt 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.