shapiq.explainer.tree.validation#

This module contains conversion functions for the tree explainer implementation.

Functions

validate_tree_model(model[, class_label, ...])

Validate the model.

shapiq.explainer.tree.validation.validate_tree_model(model, class_label=None, output_type='raw')[source]#

Validate the model.

Parameters:
  • model (Any) – The model to validate.

  • class_label (Optional[int]) – The class label of the model to explain. Only used for classification models.

  • output_type (str) – The output type of the model. Can be “raw” (default), “probability”, or “logit”. # TODO: add support for “probability” and “logit”

Return type:

Union[TreeModel, list[TreeModel]]

Returns:

The validated model and the model function.