Shapelet可视化工具¶
- class ShapeletVisualizer(values, normalise=False, dilation=1, threshold=None, length=None)[source]¶
用于绘图操作的Shapelet对象。
- Parameters:
- valuesarray, shape=(n_channels, length)
形状的值。
- normalisebool
形状是否使用归一化距离。
- dilationint
形状的扩张。默认值为1,相当于没有扩张。
- thresholdfloat
Shapelet Occurrence特征的Lambda阈值。如果未使用(在RDST中使用),则默认值为None。
- lengthint
形状的长度。默认值为None,意味着长度是从值数组中推断出来的。否则,值数组的第二轴将被设置为这个长度。
方法
plot([ax, scatter_options, line_options, ...])绘制形状值。
plot_distance_vector(X[, ax, show_legend, ...])绘制其自身与X之间计算出的形状距离向量。
plot_on_X(X[, ax, scatter_options, ...])在时间序列X上绘制其最佳匹配的形状。
- plot(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]¶
绘制形状值。
- Parameters:
- axmatplotlib axe
用于绘制图形的matplotlib轴。默认值为None,将创建一个大小为figsize的新图形。
- line_optionsdict
应用于形状值绘图的选项。
- scatter_optionsdict
应用于形状值散点图的选项。
- figure_optionsdict
传递给plt.figure的选项字典。仅在ax为None时使用。
- rc_Params_options: dict
传递给plt.rcParams.update的选项字典。仅在ax为None时使用。
- matplotlib_style: str
使用的Matplotlib样式。仅在ax为None时使用。
- custom_title_stringstr
如果不是None,使用此字符串作为图表的标题,而不是基于shapelet参数的默认标题。
- Returns:
- figmatplotlib figure
结果图
- plot_on_X(X, ax=None, scatter_options={'alpha': 0.75, 'c': 'purple', 's': 40, 'zorder': 1}, 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]¶
在时间序列X上绘制其最佳匹配的形状。
- Parameters:
- Xarray, shape=(n_features, n_timestamps)
输入时间序列
- axmatplotlib axe
用于绘制图形的matplotlib轴。默认值为None,将创建一个大小为figsize的新图形。
- scatter_optionsdict
传递给形状值散点图的选项字典。
- line_optionsdict
传递给时间序列值绘图的选项字典。
- figure_optionsdict
传递给plt.figure的选项字典。仅在ax为None时使用。
- rc_Params_options: dict
传递给plt.rcParams.update的选项字典。仅在ax为None时使用。
- matplotlib_style: str
使用的Matplotlib样式。仅在ax为None时使用。
- Returns:
- figmatplotlib figure
结果图显示了S在X上的最佳匹配。一个归一化的shapelet将被缩放以匹配X的尺度。
- plot_distance_vector(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]¶
绘制其自身与X之间计算出的形状距离向量。
- Parameters:
- Xarray, shape=(n_features, n_timestamps)
输入时间序列
- axmatplotlib axe
用于绘制图形的matplotlib轴。默认值为None,将创建一个大小为figsize的新图形。
- show_legendbool, optional
是否显示图例。默认为True
- show_threshold: bool, optional
是否显示阈值(如果未设置为None)。默认为True。
- threshold_optionsdict
传递给阈值线图的选项字典。
- line_optionsdict
传递给距离向量值绘图的选项字典。
- figure_optionsdict
传递给plt.figure的选项字典。仅在ax为None时使用。
- rc_Params_options: dict
传递给plt.rcParams.update的选项字典。仅在ax为None时使用。
- matplotlib_style: str
使用的Matplotlib样式。仅在ax为None时使用。
- Returns:
- figmatplotlib figure
通过d(S,X)获得的距离向量的结果图