|
пре 2 година | |
---|---|---|
.. | ||
dist | пре 2 година | |
test | пре 2 година | |
.gitattributes | пре 2 година | |
.npmignore | пре 2 година | |
Gruntfile.js | пре 2 година | |
README.md | пре 2 година | |
browser.js | пре 2 година | |
distance.js | пре 2 година | |
kinit.js | пре 2 година | |
main.js | пре 2 година | |
package.json | пре 2 година |
Super fast simple k-means and k-means++ implementation for unidimiensional and multidimensional data. Works on nodejs and browser.
npm install skmeans
const skmeans = require("skmeans");
var data = [1,12,13,4,25,21,22,3,14,5,11,2,23,24,15];
var res = skmeans(data,3);
<!doctype html>
<html>
<head>
<script src="skmeans.js"></script>
</head>
<body>
<script>
var data = [1,12,13,4,25,21,22,3,14,5,11,2,23,24,15];
var res = skmeans(data,3);
console.log(res);
</script>
</body>
</html>
{
it: 2,
k: 3,
idxs: [ 2, 0, 0, 2, 1, 1, 1, 2, 0, 2, 0, 2, 1, 1, 0 ],
centroids: [ 13, 23, 3 ]
}
Calculates unidimiensional and multidimensional k-means clustering on data. Parameters are:
The function will return an object with the following data: