TSEvo
TSEvo(model, data, transformer='authentic_opposing_information', epochs=500, mode='time', backend='PYT', verbose=0)
Bases: CF
Calculates and Visualizes Counterfactuals for Uni- and Multivariate Time Series in accordance to the paper [1].
References
[1] Höllig, Jacqueline , et al. "TSEvo: Evolutionary Counterfactual Explanations for Time Series Classification." 21st IEEE International Conference on Machine Learning and Applications (ICMLA). IEEE, 2022.
PARAMETER | DESCRIPTION |
---|---|
model |
Model to be interpreted.
TYPE:
|
data |
Reference Dataset as Tuple (x,y).
TYPE:
|
transformer |
['authentic_opposing_information','mutate_both','mutate_mean','frequency_band_mapping']
TYPE:
|
epochs |
Maximal Number of Itertions
TYPE:
|
mode |
Name of second dimension: time -> (-1, time, feature) or feat -> (-1, feature, time)
TYPE:
|
backend |
desired Model Backend ('PYT', 'TF', 'SK').
TYPE:
|
verbose |
Logging Level
TYPE:
|
explain(original_x, original_y, target_y=None)
Entry Point to explain a instance.
Arguments:
original_x (np.array): The instance to explain. Shape mode = time
-> (1,time, feat)
or mode = time
-> (1,feat, time)
original_y (np.array): Classification Probability of instance.
target_y int: Class to be targeted
RETURNS | DESCRIPTION |
---|---|
[np.array, int]: Returns the Counterfactual and the class. Shape of CF : |