@thi.ng/k-means 0.6.88 → 0.6.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-05-08T18:24:32Z
3
+ - **Last updated**: 2024-06-29T09:28:36Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [0.6.89](https://github.com/thi-ng/umbrella/tree/@thi.ng/k-means@0.6.89) (2024-06-21)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - enforce uniform naming convention of internal functions ([56992b2](https://github.com/thi-ng/umbrella/commit/56992b2))
17
+
12
18
  ### [0.6.85](https://github.com/thi-ng/umbrella/tree/@thi.ng/k-means@0.6.85) (2024-04-20)
13
19
 
14
20
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 192 standalone projects, maintained as part
10
+ > This is one of 189 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
@@ -59,7 +59,7 @@ For Node.js REPL:
59
59
  const kmeans = await import("@thi.ng/k-means");
60
60
  ```
61
61
 
62
- Package sizes (brotli'd, pre-treeshake): ESM: 868 bytes
62
+ Package sizes (brotli'd, pre-treeshake): ESM: 870 bytes
63
63
 
64
64
  ## Dependencies
65
65
 
package/kmeans.js CHANGED
@@ -23,7 +23,7 @@ const kmeans = (k, samples, opts) => {
23
23
  const clusters = new Uint32Array(num).fill(k);
24
24
  let update = true;
25
25
  while (update && maxIter-- > 0) {
26
- update = assign(samples, centroids, clusters, dist);
26
+ update = __assign(samples, centroids, clusters, dist);
27
27
  if (!update) break;
28
28
  for (let i = 0; i < k; i++) {
29
29
  const impl = strategy(dim);
@@ -34,7 +34,7 @@ const kmeans = (k, samples, opts) => {
34
34
  if (centroid) centroids[i] = centroid;
35
35
  }
36
36
  }
37
- return buildClusters(centroids, clusters);
37
+ return __buildClusters(centroids, clusters);
38
38
  };
39
39
  const initKmeanspp = (k, samples, dist = DIST_SQ, rnd = SYSTEM) => {
40
40
  const num = samples.length;
@@ -61,7 +61,7 @@ const initKmeanspp = (k, samples, dist = DIST_SQ, rnd = SYSTEM) => {
61
61
  }
62
62
  return centroidIDs;
63
63
  };
64
- const assign = (samples, centroids, assignments, dist) => {
64
+ const __assign = (samples, centroids, assignments, dist) => {
65
65
  let update = false;
66
66
  for (let i = samples.length; i-- > 0; ) {
67
67
  const id = argmin(samples[i], centroids, dist);
@@ -72,7 +72,7 @@ const assign = (samples, centroids, assignments, dist) => {
72
72
  }
73
73
  return update;
74
74
  };
75
- const buildClusters = (centroids, assignments) => {
75
+ const __buildClusters = (centroids, assignments) => {
76
76
  const clusters = [];
77
77
  for (let i = 0, n = assignments.length; i < n; i++) {
78
78
  const id = assignments[i];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/k-means",
3
- "version": "0.6.88",
3
+ "version": "0.6.90",
4
4
  "description": "Configurable k-means & k-medians (with k-means++ initialization) for n-D vectors",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
12
12
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/k-means#readme",
13
+ "homepage": "https://thi.ng/k-means",
14
14
  "funding": [
15
15
  {
16
16
  "type": "github",
@@ -36,17 +36,17 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.11.2",
40
- "@thi.ng/distance": "^2.4.73",
41
- "@thi.ng/errors": "^2.5.7",
42
- "@thi.ng/random": "^3.8.0",
43
- "@thi.ng/vectors": "^7.10.31"
39
+ "@thi.ng/api": "^8.11.4",
40
+ "@thi.ng/distance": "^2.4.75",
41
+ "@thi.ng/errors": "^2.5.9",
42
+ "@thi.ng/random": "^3.8.2",
43
+ "@thi.ng/vectors": "^7.11.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@microsoft/api-extractor": "^7.43.2",
47
- "esbuild": "^0.21.1",
46
+ "@microsoft/api-extractor": "^7.47.0",
47
+ "esbuild": "^0.21.5",
48
48
  "typedoc": "^0.25.13",
49
- "typescript": "^5.4.5"
49
+ "typescript": "^5.5.2"
50
50
  },
51
51
  "keywords": [
52
52
  "cluster",
@@ -83,5 +83,5 @@
83
83
  "status": "beta",
84
84
  "year": 2021
85
85
  },
86
- "gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
86
+ "gitHead": "7b950c112fba0b2e7c450765b15624c3382f1354\n"
87
87
  }