clustering KMeans

new KMeans(matrix, K, metricopt, seedopt, initopt) → {KMeans}

Parameters:
NameTypeAttributesDefaultDescription
matrixMatrix
KNumbers
metricfunction<optional>
euclidean
seedNumber<optional>
1987
initBoolean<optional>
true
To Do
  • needs restructuring.
Returns:
Type: 
KMeans

Methods

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.