depictr.silhouette_plot#

depictr.silhouette_plot(data, cols=None, k=3, title=None)#

Silhouette widths per observation, grouped and ordered by cluster.

k-means is run on the standardised data and the silhouette width of each observation is drawn as a horizontal bar, sorted within its cluster and coloured by cluster. A dashed reference line marks the mean silhouette width, a quick read on how well-separated the clustering is overall.

Parameters:
  • data (pandas.DataFrame)

  • cols (list of str, optional) – Numeric columns to use; defaults to all numeric columns.

  • k (int) – Number of clusters.

  • title (str, optional)

Return type:

plotnine.ggplot