Visualization#

thetan.viz

Plotting helpers for clustering results. Needs matplotlib and scikit-learn.

thetan.viz.plot_centroids_clusters(data, centroids, labels=None, title=None, exp_type=None, gt_centroids=None, uncertain_data=None, final_counts=None, final_nearc_value=None, merged_centroids=None, show=True, maxwindow=False, savefn=None, centroids_label=True)#
thetan.viz.plot_centroids_colormap_by_counts(data, centroids, centroid_counts, labels=None, title=None, cmap='magma', alpha_points=0.2, centroids_label=True, show=True, maxwindow=False, savefn=None)#

Plot data with same point coloring behavior as plot_centroids_clusters, but color centroids using a colormap according to centroid_counts.

thetan.viz.project_to_2d(data)#
thetan.viz.visualize_separation(data, centroids, labels, result, save_path=None, show=True)#

Visualize the separation (discs with bridge in between) results for n-dimensional data. Automatically projects to 2D if data has more than 2 dimensions.

Parameters: * data: Original Data. * centroids: Original centroids. * labels: Original labels. * results: dict which the filtered_data, filtered_centroids, filtered_labels. * save_path: Path to save figure. * show: Whether to display the plot.

Returns: * A plot.