extendedMD.viz

extendedMD.viz.create_motif_table(motif_dic_list)

This function creates a pandas dataframe with a summary of each motif in motif_dic_list

Parameters:motif_dic_list (list of dic) – list of dictionaries, where a dic is related to a single motif
Returns:motif_table_df
Return type:pandas.DataFrame
extendedMD.viz.plot_k_motifs(k, ts, events_ts, motif_dic_list, y_label='Full 1-d time-series')

This function prints the base visualisation for the first k motifs in motif_dic_list for the original 1-d time-series

Parameters:
  • k (int) – number of motifs to plot
  • ts (1d array) – original 1-dimensional time-series
  • events_ts (list) – list of labels for each entry in ts
  • motif_dic_list (list of dic) – list of dictionaries, where a dic is related to a single motif
  • y_label (str) – label to add in the y-axis of the first plot (optional and defaults to ‘Full 1-d time-series’)
Returns:

None

extendedMD.viz.plot_k_multdim_motifs(k, multidim_ts, events_ts, motif_dic_list)

This function prints the base visualisation for the first k motifs in motif_dic_list for the original multidimensional time-series. It shows one 1-d plot for each dimension in multidim_ts

Parameters:
  • k (int) – number of motifs to plot
  • multidim_ts (pandas.DataFrame) – original multidimensional time-series
  • events_ts (list) – list of labels for each entry in multidim_ts
  • motif_dic_list (list of dic) – list of dictionaries, where a dic is related to a single motif
Returns:

None

extendedMD.viz.plot_single_motif(ts, events_ts, motif_dic, y_label)
This function creates the base visualization for a single motif:
  1. plot with the whole time-series highlighting the labels and the position of each motif’s member
  2. plot with all the motif’s members
  3. plot with the motif’s center
Parameters:
  • ts (1d array) – original 1-dimensional time-series
  • events_ts (list) – list of labels for each entry in ts (max of 10 labels for avoiding color cycling in the plots) label == 0 is assumed to represent no events and thus it is not plotted
  • motif_dic (dic) – dictionary related to the motif
  • y_label (str) – label to add in the y-axis of the first plot
Returns:

fig - figure with the motif plot

Return type:

matplotlib.figure.Figure