rise_tabular

RISE tabular explainer.

Classes

RISETabular

RISE explainer for tabular data.

Module Contents

class rise_tabular.RISETabular(training_data: numpy.array, mode: str = 'classification', feature_names: List[str] = None, categorical_features: List[int] = None, n_masks: int = 1000, feature_res: int = 8, p_keep: float = 0.5, preprocess_function: callable | None = None, class_names=None, keep_masks: bool = False, keep_masked: bool = False, keep_predictions: bool = False)[source]

RISE explainer for tabular data.

training_data[source]
n_masks[source]
feature_res[source]
p_keep[source]
preprocess_function[source]
masks = None[source]
masked = None[source]
predictions = None[source]
keep_masks[source]
keep_masked[source]
keep_predictions[source]
mode[source]
explain(model_or_function: str | callable, input_tabular: numpy.array, labels: Iterable[int] | None = None, mask_type: str | callable | None = 'most_frequent', batch_size: int | None = 100) numpy.array[source]

Run the RISE explainer.

Parameters:
  • model_or_function – The function that runs the model to be explained or the path to a ONNX model on disk.

  • input_tabular – Data to be explained.

  • labels – Indices of classes to be explained.

  • num_samples – Number of samples

  • mask_type – Imputation strategy for masked features

  • batch_size – Number of samples to process by the model per batch

Returns:

An Explanation object containing the LIME explanations for each class.

Return type:

explanation