@thi.ng/k-means 0.5.5 → 0.5.8

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**: 2021-11-21T17:09:28Z
3
+ - **Last updated**: 2022-03-11T12:13:49Z
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.
package/README.md CHANGED
@@ -51,7 +51,7 @@ node --experimental-repl-await
51
51
  > const kMeans = await import("@thi.ng/k-means");
52
52
  ```
53
53
 
54
- Package sizes (gzipped, pre-treeshake): ESM: 988 bytes
54
+ Package sizes (gzipped, pre-treeshake): ESM: 987 bytes
55
55
 
56
56
  ## Dependencies
57
57
 
@@ -139,4 +139,4 @@ If this project contributes to an academic publication, please cite it as:
139
139
 
140
140
  ## License
141
141
 
142
- © 2021 Karsten Schmidt // Apache Software License 2.0
142
+ © 2021 - 2022 Karsten Schmidt // Apache Software License 2.0
package/kmeans.d.ts CHANGED
@@ -8,9 +8,9 @@ import type { CentroidStrategy, Cluster, KMeansOpts } from "./api.js";
8
8
  * @remarks
9
9
  * https://en.wikipedia.org/wiki/K-medians_clustering
10
10
  *
11
- * @param k
12
- * @param samples
13
- * @param opts
11
+ * @param k -
12
+ * @param samples -
13
+ * @param opts -
14
14
  */
15
15
  export declare const kmeans: <T extends ReadonlyVec>(k: number, samples: T[], opts?: Partial<KMeansOpts> | undefined) => Cluster[];
16
16
  /**
@@ -28,17 +28,17 @@ export declare const kmeans: <T extends ReadonlyVec>(k: number, samples: T[], op
28
28
  * - http://ilpubs.stanford.edu:8090/778/1/2006-13.pdf
29
29
  * - http://vldb.org/pvldb/vol5/p622_bahmanbahmani_vldb2012.pdf (TODO)
30
30
  *
31
- * @param k
32
- * @param samples
33
- * @param dist
34
- * @param rnd
31
+ * @param k -
32
+ * @param samples -
33
+ * @param dist -
34
+ * @param rnd -
35
35
  */
36
36
  export declare const initKmeanspp: <T extends ReadonlyVec>(k: number, samples: T[], dist?: IDistance<ReadonlyVec>, rnd?: import("@thi.ng/random/system").SystemRandom) => number[];
37
37
  /**
38
38
  * Default centroid strategy forming new centroids by averaging the position of
39
39
  * participating samples.
40
40
  *
41
- * @param dim
41
+ * @param dim -
42
42
  */
43
43
  export declare const means: CentroidStrategy;
44
44
  /**
package/kmeans.js CHANGED
@@ -15,9 +15,9 @@ import { zeroes } from "@thi.ng/vectors/setn";
15
15
  * @remarks
16
16
  * https://en.wikipedia.org/wiki/K-medians_clustering
17
17
  *
18
- * @param k
19
- * @param samples
20
- * @param opts
18
+ * @param k -
19
+ * @param samples -
20
+ * @param opts -
21
21
  */
22
22
  export const kmeans = (k, samples, opts) => {
23
23
  let { dist, initial, maxIter, rnd, strategy } = {
@@ -72,10 +72,10 @@ export const kmeans = (k, samples, opts) => {
72
72
  * - http://ilpubs.stanford.edu:8090/778/1/2006-13.pdf
73
73
  * - http://vldb.org/pvldb/vol5/p622_bahmanbahmani_vldb2012.pdf (TODO)
74
74
  *
75
- * @param k
76
- * @param samples
77
- * @param dist
78
- * @param rnd
75
+ * @param k -
76
+ * @param samples -
77
+ * @param dist -
78
+ * @param rnd -
79
79
  */
80
80
  export const initKmeanspp = (k, samples, dist = DIST_SQ, rnd = SYSTEM) => {
81
81
  const num = samples.length;
@@ -128,7 +128,7 @@ const buildClusters = (centroids, clusters) => {
128
128
  * Default centroid strategy forming new centroids by averaging the position of
129
129
  * participating samples.
130
130
  *
131
- * @param dim
131
+ * @param dim -
132
132
  */
133
133
  export const means = (dim) => {
134
134
  const acc = zeroes(dim);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/k-means",
3
- "version": "0.5.5",
3
+ "version": "0.5.8",
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",
@@ -34,19 +34,19 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.3.2",
38
- "@thi.ng/distance": "^2.1.5",
39
- "@thi.ng/errors": "^2.1.2",
40
- "@thi.ng/random": "^3.2.2",
41
- "@thi.ng/vectors": "^7.4.1"
37
+ "@thi.ng/api": "^8.3.4",
38
+ "@thi.ng/distance": "^2.1.8",
39
+ "@thi.ng/errors": "^2.1.4",
40
+ "@thi.ng/random": "^3.2.4",
41
+ "@thi.ng/vectors": "^7.5.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@microsoft/api-extractor": "^7.18.19",
45
- "@thi.ng/testament": "^0.2.2",
44
+ "@microsoft/api-extractor": "^7.19.4",
45
+ "@thi.ng/testament": "^0.2.4",
46
46
  "rimraf": "^3.0.2",
47
47
  "tools": "^0.0.1",
48
- "typedoc": "^0.22.9",
49
- "typescript": "^4.5.2"
48
+ "typedoc": "^0.22.13",
49
+ "typescript": "^4.6.2"
50
50
  },
51
51
  "keywords": [
52
52
  "cluster",
@@ -82,5 +82,5 @@
82
82
  "status": "beta",
83
83
  "year": 2021
84
84
  },
85
- "gitHead": "32cf1a96854f9bb97aca65ffa05ca862ea377059\n"
85
+ "gitHead": "0fc692a3225c068aacafdc4cb6140cf603c67ad8\n"
86
86
  }