clustering KMedoids

new KMedoids(matrix, K, max_iteropt, metricopt, seedopt) → {KMedoids}

Parameters:
NameTypeAttributesDefaultDescription
matrixMatrix

data matrix

KNumbers

number of clusters

max_iternumber<optional>
null

maximum number of iterations. Default is 10 * Math.log10(N)

metricfunction<optional>
euclidean

metric defining the dissimilarity

seedNumber<optional>
1212

seed value for random number generator

See
To Do
  • needs restructuring.
Returns:
Type: 
KMedoids

Methods

_get_random_medoids(K)

Algorithm 3. FastPAM LAB: Linear Approximate BUILD initialization.

Parameters:
NameTypeDescription
Knumber

number of clusters

_iteration()

Algorithm 2. FastPAM2: SWAP with multiple candidates

get_clusters() → {Array.<Array>}

Returns:
  • Array of clusters with the indices of the rows in given matrix.
Type: 
Array.<Array>

init(K)

Computes K clusters out of the matrix.

Parameters:
NameTypeDescription
KNumber

number of clusters.