@thi.ng/k-means
Advanced tools
Comparing version 0.6.87 to 0.6.88
# Change Log | ||
- **Last updated**: 2024-04-23T07:02:18Z | ||
- **Last updated**: 2024-05-08T18:24:32Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -5,0 +5,0 @@ |
@@ -27,4 +27,3 @@ import { argmin } from "@thi.ng/distance/argmin"; | ||
update = assign(samples, centroids, clusters, dist); | ||
if (!update) | ||
break; | ||
if (!update) break; | ||
for (let i = 0; i < k; i++) { | ||
@@ -36,4 +35,3 @@ const impl = strategy(dim); | ||
const centroid = impl.finish(); | ||
if (centroid) | ||
centroids[i] = centroid; | ||
if (centroid) centroids[i] = centroid; | ||
} | ||
@@ -58,4 +56,3 @@ } | ||
}); | ||
if (!psum) | ||
break; | ||
if (!psum) break; | ||
let id; | ||
@@ -122,7 +119,5 @@ do { | ||
finish: () => { | ||
if (!n) | ||
return; | ||
if (!n) return; | ||
lat /= n; | ||
if (lat > 180) | ||
lat -= 360; | ||
if (lat > 180) lat -= 360; | ||
lon /= n; | ||
@@ -129,0 +124,0 @@ return [lat, lon]; |
{ | ||
"name": "@thi.ng/k-means", | ||
"version": "0.6.87", | ||
"version": "0.6.88", | ||
"description": "Configurable k-means & k-medians (with k-means++ initialization) for n-D vectors", | ||
@@ -39,13 +39,13 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.11.1", | ||
"@thi.ng/distance": "^2.4.72", | ||
"@thi.ng/errors": "^2.5.6", | ||
"@thi.ng/random": "^3.7.5", | ||
"@thi.ng/vectors": "^7.10.30" | ||
"@thi.ng/api": "^8.11.2", | ||
"@thi.ng/distance": "^2.4.73", | ||
"@thi.ng/errors": "^2.5.7", | ||
"@thi.ng/random": "^3.8.0", | ||
"@thi.ng/vectors": "^7.10.31" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.43.0", | ||
"esbuild": "^0.20.2", | ||
"typedoc": "^0.25.12", | ||
"typescript": "^5.4.3" | ||
"@microsoft/api-extractor": "^7.43.2", | ||
"esbuild": "^0.21.1", | ||
"typedoc": "^0.25.13", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -87,3 +87,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "aed3421c21044c005fbcb7cc37965ccf85a870d2\n" | ||
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n" | ||
} |
33375
251
Updated@thi.ng/api@^8.11.2
Updated@thi.ng/distance@^2.4.73
Updated@thi.ng/errors@^2.5.7
Updated@thi.ng/random@^3.8.0
Updated@thi.ng/vectors@^7.10.31