omnixai.explainers.timeseries package

omnixai.explainers.timeseries.auto module

class omnixai.explainers.timeseries.auto.TimeseriesExplainer(explainers, mode, data, model, preprocess=None, postprocess=None, params=None)

Bases: AutoExplainerBase

The class derived from AutoExplainerBase for time series tasks, allowing users to choose multiple explainers and generate different explanations at the same time.

explainers = TimeseriesExplainer(
    explainers=["shap", "mace"],
    mode="anomaly_detection",
    data=data,
    model=model,
    preprocess=preprocess_function,
    postprocess=None
)
local_explanations = explainers.explain(x)
Parameters
  • explainers (Collection) – The names or alias of the explainers to use.

  • mode (str) – The task type, e.g., anomaly_detection or forecasting.

  • data (Timeseries) – The training time series data used to initialize explainers. data can be the training dataset for training the machine learning model.

  • model (Any) – The machine learning model to explain, which can be a scikit-learn model, a tensorflow model, a torch model, or a black=box prediction function.

  • preprocess (Optional[Callable]) – The preprocessing function that converts the raw features into the inputs of model.

  • postprocess (Optional[Callable]) – The postprocessing function that transforms the outputs of model to a user-specific form.

  • params (Optional[Dict]) – A dict containing the additional parameters for initializing each explainer, e.g., params[“shap”] = {“param_1”: param_1, …}.

static list_explainers()

List the supported explainers.

Subpackages