KMeansPartitioner#

class KMeansPartitioner(max_iter=100)[исходный код]#

Базовые классы: Partitioner

Partitions a sample by one run of k-means with k-means++ initial centers.

The run is single rather than the best of several: repeated runs with different randomness are the responsibility of a multistart.

Параметры:

max_iter (int or numpy.integer, default=100) – Number of iterations. Exactly this many iterations are performed and convergence is not checked. The default is 100 because the default ten iterations of kmeans2 are often not enough.

Переменные:

max_iter (int) – Number of iterations passed to kmeans2.

Исключение:

ValueError – If max_iter is not a positive integer.

Methods

partition(X, k, rng)

Divide the sample into k clusters by one k-means run.