partition#

RandomCentersPartitioner.partition(X, k, rng)[исходный код]#

Divide the sample between randomly drawn centers.

Параметры:
  • X (UnivariateFloatArray) – One-dimensional sample of finite values; the caller ensures that it has at least k distinct values.

  • k (int) – Number of clusters.

  • rng (numpy.random.Generator) – Generator from which the centers are drawn.

Результат:

Partition matrix of shape (n, k); column j is the cluster of the j-th drawn center.

Тип результата:

MultivariateFloatArray