JSPM

kmeans-clust

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q33307F
  • License MIT

k-means clustering in TypeScript

Package Exports

  • kmeans-clust

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kmeans-clust) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

kmeans-clust

k-means clustering in TypeScript

NPM Build Status

Installation

Library can be installed via npm.

$ npm install kmeans-clust

Example

import {kmeans} from "kmeans-clust";
const points = [[0], [1], [9], [10]];
kmeans(points, 2)
 //=> [ { centroid: [ 0.5 ], points: [ [Array], [Array] ], error: 1 },
 //=>   { centroid: [ 9.5 ], points: [ [Array], [Array] ], error: 1 } ]

To run graphic example execute command

$ npm run example

Live example is available https://mleko.gitlab.io/kmeans-clust/

License (MIT)