kmeans-clust
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

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)

Package Sidebar

Install

npm i kmeans-clust

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

1.35 MB

Total Files

39

Last publish

Collaborators

  • mleko