Skip to main content

PrepareWithoutTargetUnit

Unit
DashAI.back.units.PrepareWithoutTargetUnit

Prepare a dataset for a task that declares no target column.

The counterpart of PrepareAndSplitUnit for tasks whose REQUIRES_TARGET is False, such as clustering. It validates the dataset against the task, keeps the input columns and, unless told not to, standardises them. Nothing is partitioned: such a task is fitted and scored over every row, because there is nothing held out to evaluate against.

It publishes the features under their own key, features, a single dataset, rather than reusing x: x is a dict of partitions, and the name of a key is part of its contract. A graph validator compares names, so a reused name with a different shape would let a wrong edge through.

n_labels is the task's answer to how many labels there are, which for a task without a target is None -- the same value a regression task gives. It is published so the unit that builds the model is fed the same way for both kinds of task.

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.
standardise : boolean, default=True
Whether every numeric input column with any variance is centred and scaled before the model sees it. Models that measure distances are otherwise dominated by the column with the widest range.

Methods​

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

Defined on PrepareWithoutTargetUnit

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.