ApplySessionPreprocessingUnit
Publish the rows as the model was trained to see them.
A session may declare preprocessing steps ahead of training. When it does,
PreprocessingJob fits them once on the training data and persists the
result, and the model is trained on the columns that fit produced rather
than on the raw ones. Predicting on new rows then means applying that same
fitted preprocessor, never refitting it on what is being predicted.
The result goes under model_input instead of replacing dataset: the
raw rows are what a prediction is saved next to, so the two have to be
live at once, the same way the training dataset keeps a key of its own.
The unit always runs, and without an artifacts path it publishes the rows
unchanged. That is what keeps the graph one shape whether or not a session
preprocesses: the prediction step reads model_input in both cases, and
what varies is this unit's configuration, not which units are wired.
Methods
execute(self, ctx: DashAI.back.units.context.ExecutionContext) -> None
ApplySessionPreprocessingUnitDo 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.