Visualization#

Static visualizations (matplotlib). Every function returns its Axes or Figure and accepts ax= where a single panel is drawn.

Matplotlib views of series, segmentations, alignments, clusterings, representations and evaluations.

Functions#

plot_series(X[, names, figsize, sharex, ...])

Small multiples: one panel per variable.

plot_segmentation(X, segmentation[, names, ...])

Series with the segments shaded (state colours if the segmentation has state labels), change points as vertical lines, optional true change points (dashed, at the top) and segment fits ("mean" or "linear").

plot_fuzzy_segmentation(X, segmentation[, names])

Two panels: the series with the crisp segments, and the fuzzy memberships of the segments along time.

plot_states(segmentation[, ax, height, names])

State timeline: one coloured bar per segment.

plot_profile(profile[, change_points, ax, ...])

A change profile (ClaSP score, FLUSS arc curve, BOCPD change probability, boundary agreement, similarity) with the detected change points.

plot_run_length(bocpd[, ax, max_run])

Run-length posterior of BOCPD (log scale) with the MAP run length.

plot_cost_curve(curve[, rr, selected, ax])

Total cost against the number of segments, with the relative reduction rate \(RR(c)\) as bars on a second axis (Bankó, 2015, Figures 3.3 and 3.6).

plot_segmentogram(tree[, max_segments, ax, ...])

Segmentogram: every level of a bottom-up merge hierarchy as one row (top: one segment, bottom: max_segments), segments drawn as alternating bands, change points as ticks coloured by their persistence.

plot_boundary_agreement(agreement[, ...])

Consensus segmentation: the change points of every member (one row each) above the boundary agreement profile.

plot_pca_statistics(X, model[, alpha, ...])

Hotelling \(T^2\) and \(Q\) of a PCA model along the series with their control limits.

plot_segment_loadings(X, segmentation[, ...])

Heatmap of the loadings of one principal component of every segment (rows: variables, columns: segments): how the correlation structure changes from segment to segment.

plot_contributions(contributions[, ax])

Stacked bars of the variable contributions to every change point (output of mvtsa.explain.boundary_contributions()).

plot_transition_graph(G[, ax, names])

Regime transition network (mvtsa.explain.transition_graph()): node size = total duration, edge width = transition probability.

plot_alignment(x, y, path[, ax, offset, ...])

The two series (y shifted down by offset) with grey lines joining the aligned samples (Bankó, 2015, Figure 2.6).

plot_cost_matrix(x, y[, path, cost, ...])

Local (or accumulated) cost matrix with the optimal warping path and the two series along the axes.

plot_alignment_uncertainty(E[, path, ax])

Expected alignment matrix of soft-DTW (probability that two samples are aligned) with the hard DTW path on top.

plot_warping_function(paths[, labels, ax])

Warping functions of one or several paths, normalized to [0, 1], against the diagonal.

plot_segment_alignment(x, y, models_x, ...)

Segment-level alignment of correlation-based DTW: both series with their segments as coloured bands and the aligned segments connected at their centres.

plot_average(collection, average[, channel, ...])

Members of a cluster (grey) and their (DBA or soft-DTW) average.

sammon(D[, n_components, max_iter, tol, ...])

Sammon mapping (Sammon, 1969) of a distance matrix by Newton-type iterations; returns (Y, stress).

fuzzy_sammon(D, U, medoids[, m, max_iter, ...])

Fuzzy Sammon mapping (Feil, Balaskó and Abonyi, 2007) for relational fuzzy clusterings: the data are mapped so that their distances to the cluster prototypes (medoids) are preserved with weights \(u_{ik}^m\); returns (Y, Z): positions of the objects and of the prototypes.

plot_dendrogram(linkage_matrix[, labels, ...])

Dendrogram of a hierarchical clustering.

plot_cluster_prototypes(collection, labels)

One panel per cluster: members (thin, grey), their mean +- standard deviation band (resampled to a common length) and the centre if given (centers is a dict label -> centre, or a sequence in the order of the sorted labels).

plot_distance_matrix(D[, labels, ax, order])

Distance matrix heatmap, ordered by labels ("label"), by the leaves of an average-linkage dendrogram ("cluster") or as given.

plot_embedding(D[, labels, method, ax, annotate])

2-D map of a distance matrix by Sammon mapping, metric MDS or t-SNE, coloured by labels.

plot_pla(x, pla[, ax, channel])

Series and its piecewise linear approximation; each segment is annotated with its slope angle.

plot_sax(x[, n_segments, alphabet_size, ax])

z-normalized series, its PAA and the SAX symbols with the Gaussian breakpoints.

plot_episodes(x, episodes[, ax, smooth, ...])

Series with its qualitative episodes: coloured bands labelled by the primitive codes and, above them, the triangular glyphs of the representation of Cheung and Stephanopoulos (1990).

plot_recurrence(R[, ax, title])

Recurrence plot (thresholded or distance matrix).

plot_visibility_graph(x, G[, ax, max_arcs])

Series as bars with its visibility arcs drawn above; if the graph is zone labelled (six_sigma_visibility_graph()) nodes are coloured by their SPC zone and the control-chart zones are shaded.

plot_critical_difference(ranks, cd[, ax, title])

Critical difference diagram (Demšar, 2006): methods on the average rank axis, with bars joining methods whose ranks differ by less than the critical difference.

plot_precision_recall(curves[, ax])

Precision against recall levels for several measures (Bankó, 2015, Figures 3.4--3.9); curves maps names to the output of precision_recall_curve_knn().

plot_metric_heatmap(table[, ax, fmt, cmap])

Heatmap of a data set x method table (e.g. Benchmark.pivot) with the values printed.

plot_stability(result[, X, ax])

Boundary frequency under perturbations (segmentation_stability()) with the reference change points and their support.

segmentation_dashboard(X, segmentation[, ...])

One-page summary of a segmentation: the segmented series, the state timeline, the cost curve (if a merge tree is given) and the variable contributions to the changes.

Constants#

BRAND

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

OKABE_ITO

Built-in mutable sequence.

CATEGORICAL

Built-in mutable sequence.