Options
All
  • Public
  • Public/Protected
  • All
Menu

ml-kmeans

Index

Type aliases

Functions

  • kmeans(data: number[][], K: number, options: Options): KMeansResult
  • K-means algorithm

    Parameters

    • data: number[][]

      Points in the format to cluster [x,y,z,...]

    • K: number

      Number of clusters

    • options: Options

    Returns KMeansResult

    • Cluster identifier for each data dot and centroids with the following fields:
    • 'clusters': Array of indexes for the clusters.
    • 'centroids': Array with the resulting centroids.
    • 'iterations': Number of iterations that took to converge