w-cluster 1.0.11 → 1.0.12
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/README.md +32 -14
- package/dist/w-cluster.umd.js +2 -2
- package/dist/w-cluster.umd.js.map +1 -1
- package/dist/w-cluster.wk.umd.js +1 -1
- package/docs/WCluster.mjs.html +31 -13
- package/docs/examples/ex-PCA.html +1 -1
- package/docs/examples/ex-cluster-webworker.html +1 -1
- package/docs/examples/ex-cluster.html +1 -1
- package/docs/global.html +3 -3
- package/docs/index.html +1 -1
- package/g-PCA-nodeworker.mjs +22 -5
- package/g-PCA.mjs +22 -5
- package/g-cluster-nodeworker.mjs +13 -21
- package/g-cluster.mjs +8 -9
- package/package.json +1 -1
- package/src/WCluster.mjs +30 -12
- package/src/WClusterCore.mjs +8 -8
- package/src/WPCAMat.mjs +26 -6
- package/test/PCA.test.mjs +4 -4
- package/test/cluster.test.mjs +54 -2
package/README.md
CHANGED
|
@@ -45,10 +45,28 @@ async function testPCA() {
|
|
|
45
45
|
let resMat = await WCluster.PCA(mat, { nCompNIPALS: 2 })
|
|
46
46
|
console.log(resMat)
|
|
47
47
|
// => [
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
48
|
+
// [ -22.27637140016484, -4.7649452046492735 ],
|
|
49
|
+
// [ -9.12778006150881, 12.303870466192656 ],
|
|
50
|
+
// [ 31.31672176507748, 0.2183960452169238 ],
|
|
51
|
+
// [ 0.08742969659617117, -7.757321306760306 ]
|
|
52
|
+
// ]
|
|
53
|
+
|
|
54
|
+
let mat2 = [
|
|
55
|
+
[1040, 50, 60],
|
|
56
|
+
[1050, 70, 60],
|
|
57
|
+
[1080, 70, 90],
|
|
58
|
+
[1050, 60, 80]
|
|
59
|
+
]
|
|
60
|
+
console.log('mat2', mat2)
|
|
61
|
+
// => mat [ [ 1040, 50, 60 ], [ 1050, 70, 60 ], [ 1080, 70, 90 ], [ 1050, 60, 80 ] ]
|
|
62
|
+
|
|
63
|
+
let resMat2 = await WCluster.PCA(mat2, { nCompNIPALS: 2 })
|
|
64
|
+
console.log(resMat2)
|
|
65
|
+
// => [
|
|
66
|
+
// [ -22.27637140016484, -4.7649452046492735 ],
|
|
67
|
+
// [ -9.12778006150881, 12.303870466192656 ],
|
|
68
|
+
// [ 31.31672176507748, 0.2183960452169238 ],
|
|
69
|
+
// [ 0.08742969659617117, -7.757321306760306 ]
|
|
52
70
|
// ]
|
|
53
71
|
|
|
54
72
|
}
|
|
@@ -85,12 +103,12 @@ async function testCluster() {
|
|
|
85
103
|
// ],
|
|
86
104
|
// "gmat": [
|
|
87
105
|
// [
|
|
88
|
-
// [
|
|
106
|
+
// [ 31.31672176507748, 0.2183960452169238 ]
|
|
89
107
|
// ],
|
|
90
108
|
// [
|
|
91
|
-
// [
|
|
92
|
-
// [
|
|
93
|
-
// [
|
|
109
|
+
// [ -22.27637140016484, -4.7649452046492735 ],
|
|
110
|
+
// [ -9.12778006150881, 12.303870466192656 ],
|
|
111
|
+
// [ 0.08742969659617117, -7.757321306760306 ]
|
|
94
112
|
// ]
|
|
95
113
|
// ],
|
|
96
114
|
// "gltdt": [
|
|
@@ -129,12 +147,12 @@ async function testCluster() {
|
|
|
129
147
|
// ],
|
|
130
148
|
// "gmat": [
|
|
131
149
|
// [
|
|
132
|
-
// [
|
|
150
|
+
// [ 31.31672176507748, 0.2183960452169238 ]
|
|
133
151
|
// ],
|
|
134
152
|
// [
|
|
135
|
-
// [
|
|
136
|
-
// [
|
|
137
|
-
// [
|
|
153
|
+
// [ -22.27637140016484, -4.7649452046492735 ],
|
|
154
|
+
// [ -9.12778006150881, 12.303870466192656 ],
|
|
155
|
+
// [ 0.08742969659617117, -7.757321306760306 ]
|
|
138
156
|
// ]
|
|
139
157
|
// ],
|
|
140
158
|
// "gltdt": [
|
|
@@ -164,9 +182,9 @@ testCluster()
|
|
|
164
182
|
```alias
|
|
165
183
|
|
|
166
184
|
<!-- for basic -->
|
|
167
|
-
<script src="https://cdn.jsdelivr.net/npm/w-cluster@1.0.
|
|
185
|
+
<script src="https://cdn.jsdelivr.net/npm/w-cluster@1.0.12/dist/w-cluster.umd.js"></script>
|
|
168
186
|
|
|
169
187
|
<!-- for web workers -->
|
|
170
|
-
<script src="https://cdn.jsdelivr.net/npm/w-cluster@1.0.
|
|
188
|
+
<script src="https://cdn.jsdelivr.net/npm/w-cluster@1.0.12/dist/w-cluster.wk.umd.js"></script>
|
|
171
189
|
|
|
172
190
|
```
|