ShapeletTransformerVisualizer

class ShapeletTransformerVisualizer(estimator)[source]

A class to visualize the result from a fitted shapelet transformer.

Parameters:
estimatorobject

A fitted shapelet transformer.

Methods

plot(id_shapelet[, ax, scatter_options, ...])

Plot the shapelet values.

plot_distance_vector(id_shapelet, X[, ax, ...])

Plot the shapelet distance vector computed between itself and X.

plot_on_X(id_shapelet, X[, ax, ...])

Plot the shapelet on its best match on the time series X.

plot_on_X(id_shapelet, X, ax=None, scatter_options={'alpha': 0.9, 'c': 'purple', 's': 40, 'zorder': 3}, line_options={'alpha': 0.9, 'linewidth': 2}, figure_options={'dpi': 100, 'figsize': (10, 5)}, rc_Params_options={'font.size': 22}, matplotlib_style='seaborn-v0_8')[source]

Plot the shapelet on its best match on the time series X.

Parameters:
id_shapeletint

ID of the shapelet to plot.

Xarray, shape=(n_features, n_timestamps)

Input time series

axmatplotlib axe

A matplotlib axe on which to plot the figure. The default is None and will create a new figure of size figsize.

scatter_optionsdict

Dictionnary of options passed to the scatter plot of the shapelet values.

line_optionsdict

Dictionnary of options passed to the plot of the time series values.

figure_optionsdict

Dictionnary of options passed to plt.figure. Only used if ax is None.

rc_Params_options: dict

Dictionnary of options passed to plt.rcParams.update. Only used if ax is None.

matplotlib_style: str

Matplotlib style to be used. Only used if ax is None.

Returns:
figmatplotlib figure

The resulting figure with S on its best match on X. A normalised shapelet will be scalled to macth the scale of X.

plot_distance_vector(id_shapelet, X, ax=None, show_legend=True, show_threshold=True, line_options={'alpha': 0.9, 'linewidth': 2}, threshold_options={'alpha': 0.9, 'color': 'purple', 'label': 'threshold', 'linewidth': 2}, figure_options={'dpi': 100, 'figsize': (10, 5)}, rc_Params_options={'font.size': 22}, matplotlib_style='seaborn-v0_8')[source]

Plot the shapelet distance vector computed between itself and X.

Parameters:
id_shapeletint

ID of the shapelet to plot.

Xarray, shape=(n_timestamps) or shape=(n_features, n_timestamps)

Input time series

axmatplotlib axe

A matplotlib axe on which to plot the figure. The default is None and will create a new figure of size figsize.

show_legendbool, optional

Wheter to show legend. Default is True

show_threshold: bool, optional

Wheter to show threshold (if it is not set to None). Default is True.

threshold_optionsdict

Dictionnary of options passed to the line plot of the threshold.

line_optionsdict

Dictionnary of options passed to the plot of the distance vector values.

figure_optionsdict

Dictionnary of options passed to plt.figure. Only used if ax is None.

rc_Params_options: dict

Dictionnary of options passed to plt.rcParams.update. Only used if ax is None.

matplotlib_style: str

Matplotlib style to be used. Only used if ax is None.

Returns:
figmatplotlib figure

The resulting figure with the distance vector obtained by d(S,X)

plot(id_shapelet, ax=None, scatter_options={'alpha': 0.75, 'edgecolor': 'black', 'linewidths': 2, 's': 70, 'zorder': 3}, line_options={'alpha': 0.9, 'linestyle': '--', 'linewidth': 2}, figure_options={'dpi': 100, 'figsize': (10, 5)}, rc_Params_options={'font.size': 22}, matplotlib_style='seaborn-v0_8', custom_title_string=None)[source]

Plot the shapelet values.

Parameters:
id_shapeletint

ID of the shapelet to plot.

axmatplotlib axe

A matplotlib axe on which to plot the figure. The default is None and will create a new figure of size figsize.

scatter_optionsdict

Options to apply to scatter plot of the shapelet values.

line_optionsdict

Dictionnary of options passed to plt.plot. Only used if ax is None.

figure_optionsdict

Dictionnary of options passed to plt.figure. Only used if ax is None.

rc_Params_options: dict

Dictionnary of options passed to plt.rcParams.update. Only used if ax is None.

matplotlib_style: str

Matplotlib style to be used. Only used if ax is None.

custom_title_stringstr

If not None, use this string as title for the plot instead of the default one based on the shapelet parametres.

Returns:
figmatplotlib figure

The resulting figure