Skip to content

explanation_artifact

Explanation result as an Artifact.

Classes:

Name Description
ExplanationArtifact

ExplanationArtifact object.

ExplanationArtifact(explanation_results_model: ExplanationResultsModel) #

ExplanationArtifact object.

Methods:

Name Description
__repr__

Get class representation without results, accessible with results attribute.

Attributes:

Name Type Description
visualisation_link
Source code in src/xpdeep/explain/explanation_artifact.py
def __init__(self, explanation_results_model: ExplanationResultsModel):
    super().__init__(*explanation_results_model.to_dict().values())
    self.visualisation_link = (
        f"{ClientFactory.CURRENT.get().api_url.removesuffix('/api')}/explanation/{self.project_id}/{self.id}"
    )

__repr__() -> str #

Get class representation without results, accessible with results attribute.

Source code in src/xpdeep/explain/explanation_artifact.py
def __repr__(self) -> str:
    """Get class representation without results, accessible with `results` attribute."""
    attributes_to_show = [
        "created_at",
        "id",
        "name",
        "project_id",
        "visualisation_link",
        "config",
    ]
    return pformat({attr: getattr(self, attr) for attr in attributes_to_show}, indent=4, width=1)