Skip to main content

k-means Clustering

K-means clustering.


  • data | object (required): object of value arrays. Default: none.
  • variables | array<string> (required): names of variables used for clustering. Default: none.
  • K | number: number of clusters. Default: 3.
  • initialization | string: initialization method (kmeans++, random, or mostDistant). Default: 'kmeans++'.
  • onResult | function: callback invoked with model object. Default: onResult() {}.


Live Editor
Last updated on by Planeshifter