Skip to content

LEFTIST

LEFTIST(model, data=None, mode='time', backend='F', transform_name='straight', segmentator_name='uniform', learning_process_name='Lime', nb_interpretable_feature=10, nb_neighbors=1000, explanation_size=1)

Bases: FeatureAttribution

Local explainer for time series classification. Wrapper for LEFTIST from [1].

References

[1] Guillemé, Maël, et al. "Agnostic local explanation for time series classification." 2019 IEEE 31st International Conference on Tools with Artificial Intelligence (ICTAI). IEEE, 2019.


Initization. Arguments: model_to_explain [torch.nn.Module, Callable, tf.keras.model]: classification model to explain. data Tuple: Reference Dataset as Tuple (x,y). mode str: Name of second dimension: time -> (-1, time, feature) or feat -> (-1, feature, time) backend str: TF, PYT or SK transform_name str: Name of transformer learning_process_name str: 'Lime' or 'Shap' nb_interpretable_feature int: number of desired features nb_neighbors int: number of neighbors to generate. explanation_size int: number of feature to use for the explanations

explain(instance, idx_label=None, random_state=0)

Compute the explanation.

PARAMETER DESCRIPTION
instance

item to be explained. Shape : mode = time -> (1,time, feat) or mode = time -> (1,feat, time)

TYPE: array

idx_label

index of label to explain. If None, return an explanation for each label.

TYPE: int DEFAULT: None

random_state

fixes seed

TYPE: int DEFAULT: 0

RETURNS DESCRIPTION
List

Attribution weight mode = time -> (explanation_size,time, feat) or mode = time -> (explanation_size,feat, time)