depictr.cluster_plot#

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

k-means clusters drawn on the first two principal components.

The data are reduced to two principal components for display, k-means is run in that two-dimensional space, and points are coloured by cluster with each cluster centroid marked by a larger outlined point.

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