{ } Raw JSON

bundles / scipy 1.17.1 / scipy / cluster / vq / _kpoints

function

scipy.cluster.vq:_kpoints

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

Signature

def   _kpoints ( data k rng xp )

Summary

Pick k points at random in data (one row = one observation).

Parameters

data : ndarray

Expect a rank 1 or 2 array. Rank 1 are assumed to describe one dimensional 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

x : ndarray

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

Aliases

  • scipy.cluster.vq._kpoints