Skip to main content

GenerateGlobalExplanationUnit

Unit
DashAI.back.units.GenerateGlobalExplanationUnit

Explain the model over the whole dataset and pickle the result.

Sibling of GenerateLocalExplanationUnit rather than one unit with a branch, for three reasons that all point the same way: the two produce different outputs (a single plot here, a set of plots plus the explained instances there), which a single PROVIDES could not describe since it is checked unconditionally; the local path has steps this one does not (fitting, selecting instances); and their configurations point at two different component registries.

The unit never touches the explanation row: it publishes where it wrote, and the job owns the columns.

Parameters​

explainer_id : integer, default=1
Identifier of the global explanation being produced. It names the files on disk, so a re-run overwrites its own artifacts and never another explanation's.

Methods​

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

Defined on GenerateGlobalExplanationUnit

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.