Saltar al contenido principal

FitWithoutTargetUnit

Unit
DashAI.back.units.FitWithoutTargetUnit

Fit a model on the features of every row, with no target column.

The counterpart of FitModelUnit for tasks whose REQUIRES_TARGET is False. It only calls model.train(features): nothing is held out, nothing is searched and nothing is scored here. The fitted instance is published under the same key it came in on, so the unit that scores it and the one that saves it see the object that was trained, not a rebuilt one.

Named after what it does rather than after clustering: it knows nothing about clusters. It accepts only ClusteringModel because that is the one family DashAI ships that trains without a target, and there is no UnsupervisedModel base to accept instead. When a second family arrives, that base is created and validate widens to it; the name stays, because saved graphs persist it.

Methods​

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

Defined on FitWithoutTargetUnit

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

Parameters

ctx : ExecutionContext
The shared execution context.

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

Defined on FitWithoutTargetUnit

Check preconditions without executing the unit.

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_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.