function kmeans_plusplus

deeptime.clustering.kmeans_plusplus(data, n_clusters: int, metric: str = 'euclidean', callback=None, seed: int = -1, n_jobs: Optional[int] = None)

Performs kmeans++ initialization. [1]

Parameters:
  • data (np.ndarray) – Input data of shape (T, n_dim).

  • n_clusters (int) – The number of cluster centers.

  • metric (str, default='euclidean') – Metric to use during clustering, default evaluates to euclidean metric. For a list of available metrics, see the metric registry.

  • callback (callable or None) – used for kmeans++ initialization to indicate progress, called once per assigned center.

  • seed (int, optional, default=-1) – The random seed. If non-negative, this fixes the random generator’s seed and makes results reproducible.

  • n_jobs (int, optional, default=None) – Number of jobs.

Returns:

centers – An (n_centers, dim)-shaped array with a kmeans++ cluster center initial guess.

Return type:

np.ndarray

References