DashAI.back.explainability.KernelShap

class KernelShap(model: BaseModel, link: str = 'identity')[source]

Kernel SHAP is a model-agnostic explainability method for approximating SHAP values to explain the output of machine learning model by attributing contributions of each feature to the model’s prediction.

__init__(model: BaseModel, link: str = 'identity')[source]

Initialize a new instance of a KernelShap explainer.

Parameters:
  • model (BaseModel) – Model to be explained.

  • link (str) – String indicating the link function to connect the feature importance values to the model’s outputs. Options are ‘identity’ to use identity function or ‘logit’to use log-odds function.

Methods

__init__(model[, link])

Initialize a new instance of a KernelShap explainer.

explain_instance(instances)

Method for explaining the model prediciton of an instance using the Kernel Shap method.

fit(background_dataset[, ...])

Method to train the KernelShap explainer.

get_schema()

Generates the component related Json Schema.

plot(explanation)

Method to create the explanation plot using plotly.

validate_and_transform(raw_data)

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.

Attributes

COMPATIBLE_COMPONENTS

TYPE