{ } Raw JSON

bundles / scipy latest / scipy / cluster / vq / _kpp

function

scipy.cluster.vq:_kpp

source: /scipy/cluster/vq.py :577

Signature

def   _kpp ( data k rng xp )

Summary

Picks k points in the data based on the kmeans++ method.

Parameters

data : ndarray

Expect a rank 1 or 2 array. Rank 1 is assumed to describe 1-D data, rank 2 multidimensional data, in which case one row is one observation.

k : int

Number of samples to generate.

rng : `numpy.random.Generator` or `numpy.random.RandomState`

Random number generator.

Returns

init : ndarray

A 'k' by 'N' containing the initial centroids.

Aliases

  • scipy.cluster.vq._kpp