Package Exports
- @ridwan-p/kmeans
- @ridwan-p/kmeans/dist/kmeans.js
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 (@ridwan-p/kmeans) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
K-Means
K-Means clustering algorithm implementation written in javascript
npm i @ridwan-p/kmeans
const data = [
[6, 2.92], [6.7, 3.07], [7.4, 3.22],
[6.7, 2.93], [9.2, 3.03], [7.4, 3.29],
[9.3, 3.28], [4.5, 2.72], [6.4, 2.92],
[8.5, 3.49], [6.9, 3.08], [5.8, 2.83],
[6.3, 3.18], [6.4, 3.2], [3.9, 3.29],
];
const kmeans = new Kmeans(data, 3)
// calculate
kmeans.run()
.then( res => { console.log('result', res) } )