@iyulab/u-insight 0.10.0 → 0.11.0
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 +4 -1
- package/package.json +2 -2
- package/u_insight.d.ts +35 -31
- package/u_insight.js +1 -1
- package/u_insight_bg.js +115 -112
- package/u_insight_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -361,7 +361,10 @@ Local Outlier Factor anomaly detection. `config`: `{ "k": 20, "threshold": 1.5 }
|
|
|
361
361
|
|
|
362
362
|
#### `distribution_analysis(data, config) -> DistributionResult`
|
|
363
363
|
|
|
364
|
-
Distribution analysis on a 1-D array. `config`: `{ "bin_method": "freedman_diaconis", "significance_level": 0.05, "compute_ecdf": true, "compute_histogram": true, "compute_qq_plot": true, "fit_distributions": false }`.
|
|
364
|
+
Distribution analysis on a 1-D array. `config`: `{ "bin_method": "freedman_diaconis", "bins": null, "significance_level": 0.05, "compute_ecdf": true, "compute_histogram": true, "compute_qq_plot": true, "fit_distributions": false }`.
|
|
365
|
+
|
|
366
|
+
- `bin_method`: `"sturges" | "scott" | "freedman_diaconis"` — automatic bin count rule (default `"freedman_diaconis"`).
|
|
367
|
+
- `bins` (optional, integer >= 1): explicit histogram bin count. When set it takes precedence over `bin_method`, and the histogram `method` field echoes `"Fixed(n)"`.
|
|
365
368
|
|
|
366
369
|
**Output:**
|
|
367
370
|
```json
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"iyulab"
|
|
6
6
|
],
|
|
7
7
|
"description": "Statistical analysis and data profiling engine with C FFI bindings.",
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.11.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"analytics",
|
|
30
30
|
"ffi"
|
|
31
31
|
]
|
|
32
|
-
}
|
|
32
|
+
}
|
package/u_insight.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Standard threshold: `cond > 30` indicates multicollinearity (Belsley 1991).
|
|
16
16
|
* Returns `Infinity` for numerically singular input.
|
|
17
17
|
*/
|
|
18
|
-
export function condition_number_diagnostic(
|
|
18
|
+
export function condition_number_diagnostic(data: any): any;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Computes a correlation matrix for a column-major dataset.
|
|
@@ -32,22 +32,22 @@ export function condition_number_diagnostic(data_json: any): any;
|
|
|
32
32
|
* # Output
|
|
33
33
|
* `{ names, matrix (flattened n×n), n, high_pairs }`
|
|
34
34
|
*/
|
|
35
|
-
export function correlation_matrix(
|
|
35
|
+
export function correlation_matrix(data: any): any;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Runs DBSCAN density-based clustering on row-major data.
|
|
39
39
|
*
|
|
40
40
|
* # Input
|
|
41
41
|
*
|
|
42
|
-
* `
|
|
42
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
43
43
|
*
|
|
44
|
-
* `
|
|
44
|
+
* `config`: `{ "epsilon": 1.5, "min_samples": 3 }`
|
|
45
45
|
*
|
|
46
46
|
* # Output
|
|
47
47
|
*
|
|
48
48
|
* `{ labels, n_clusters, noise_count, cluster_sizes, core_points }`
|
|
49
49
|
*/
|
|
50
|
-
export function dbscan(
|
|
50
|
+
export function dbscan(data: any, config: any): any;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Returns descriptive statistics for each column in a column-major dataset.
|
|
@@ -67,7 +67,7 @@ export function dbscan(data_json: any, config_json: any): any;
|
|
|
67
67
|
* # Output
|
|
68
68
|
* Array of column profile objects, one per column.
|
|
69
69
|
*/
|
|
70
|
-
export function describe(
|
|
70
|
+
export function describe(data: any): any;
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Univariate outlier detection on a flat numeric vector.
|
|
@@ -85,31 +85,35 @@ export function describe(data_json: any): any;
|
|
|
85
85
|
* `method` aliases: `tukey` → IQR Tukey fences (k=1.5), `three_sigma` →
|
|
86
86
|
* mean ± 3·σ, `hampel` → robust median ± 3.5·(MAD/0.6745).
|
|
87
87
|
*/
|
|
88
|
-
export function detect_univariate_outliers(
|
|
88
|
+
export function detect_univariate_outliers(data: any): any;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Runs distribution analysis on a 1-D numeric array.
|
|
92
92
|
*
|
|
93
93
|
* # Input
|
|
94
94
|
*
|
|
95
|
-
* `
|
|
95
|
+
* `data`: flat array `[1.0, 2.0, 3.0, ...]`
|
|
96
96
|
*
|
|
97
|
-
* `
|
|
98
|
-
* "
|
|
99
|
-
* "fit_distributions": false }`
|
|
97
|
+
* `config`: `{ "bin_method": "freedman_diaconis", "bins": null,
|
|
98
|
+
* "significance_level": 0.05, "compute_ecdf": true, "compute_histogram": true,
|
|
99
|
+
* "compute_qq_plot": true, "fit_distributions": false }`
|
|
100
|
+
*
|
|
101
|
+
* `bins` (optional, >= 1): explicit histogram bin count; when set it takes
|
|
102
|
+
* precedence over `bin_method`. The histogram `method` field echoes
|
|
103
|
+
* `"Fixed(n)"` in that case.
|
|
100
104
|
*
|
|
101
105
|
* # Output
|
|
102
106
|
*
|
|
103
107
|
* `{ n, ecdf, histogram, qq_plot, normality, fits }`
|
|
104
108
|
*/
|
|
105
|
-
export function distribution_analysis(
|
|
109
|
+
export function distribution_analysis(data: any, config: any): any;
|
|
106
110
|
|
|
107
111
|
/**
|
|
108
112
|
* Computes feature importance using one of three methods.
|
|
109
113
|
*
|
|
110
114
|
* # Input
|
|
111
115
|
*
|
|
112
|
-
* `
|
|
116
|
+
* `data`:
|
|
113
117
|
* ```json
|
|
114
118
|
* {
|
|
115
119
|
* "features": { "f1": [1,2,3,4,5], "f2": [5,4,3,2,1] },
|
|
@@ -127,38 +131,38 @@ export function distribution_analysis(data_json: any, config_json: any): any;
|
|
|
127
131
|
*
|
|
128
132
|
* `{ method, features: [{ name, index, score, std_dev?, p_value? }], baseline_score?, selected_indices? }`
|
|
129
133
|
*/
|
|
130
|
-
export function feature_importance(
|
|
134
|
+
export function feature_importance(data: any): any;
|
|
131
135
|
|
|
132
136
|
/**
|
|
133
137
|
* Runs hierarchical agglomerative clustering on row-major data.
|
|
134
138
|
*
|
|
135
139
|
* # Input
|
|
136
140
|
*
|
|
137
|
-
* `
|
|
141
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
138
142
|
*
|
|
139
|
-
* `
|
|
143
|
+
* `config`: `{ "linkage": "ward", "n_clusters": 3 }` or
|
|
140
144
|
* `{ "linkage": "single", "distance_threshold": 5.0 }`
|
|
141
145
|
*
|
|
142
146
|
* # Output
|
|
143
147
|
*
|
|
144
148
|
* `{ merges, labels, n_clusters }`
|
|
145
149
|
*/
|
|
146
|
-
export function hierarchical(
|
|
150
|
+
export function hierarchical(data: any, config: any): any;
|
|
147
151
|
|
|
148
152
|
/**
|
|
149
153
|
* Runs Isolation Forest anomaly detection on row-major data.
|
|
150
154
|
*
|
|
151
155
|
* # Input
|
|
152
156
|
*
|
|
153
|
-
* `
|
|
157
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
154
158
|
*
|
|
155
|
-
* `
|
|
159
|
+
* `config`: `{ "n_estimators": 100, "contamination": 0.1, "seed": 42 }`
|
|
156
160
|
*
|
|
157
161
|
* # Output
|
|
158
162
|
*
|
|
159
163
|
* `{ scores, anomalies, threshold, anomaly_count, anomaly_fraction }`
|
|
160
164
|
*/
|
|
161
|
-
export function isolation_forest(
|
|
165
|
+
export function isolation_forest(data: any, config: any): any;
|
|
162
166
|
|
|
163
167
|
/**
|
|
164
168
|
* Runs K-Means++ clustering on row-major data.
|
|
@@ -171,22 +175,22 @@ export function isolation_forest(data_json: any, config_json: any): any;
|
|
|
171
175
|
* # Output
|
|
172
176
|
* `{ k, labels, centroids, wcss, iterations, cluster_sizes }`
|
|
173
177
|
*/
|
|
174
|
-
export function kmeans(
|
|
178
|
+
export function kmeans(data: any, k: number): any;
|
|
175
179
|
|
|
176
180
|
/**
|
|
177
181
|
* Runs Local Outlier Factor anomaly detection on row-major data.
|
|
178
182
|
*
|
|
179
183
|
* # Input
|
|
180
184
|
*
|
|
181
|
-
* `
|
|
185
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
182
186
|
*
|
|
183
|
-
* `
|
|
187
|
+
* `config`: `{ "k": 20, "threshold": 1.5 }`
|
|
184
188
|
*
|
|
185
189
|
* # Output
|
|
186
190
|
*
|
|
187
191
|
* `{ scores, anomalies, threshold, anomaly_count, anomaly_fraction }`
|
|
188
192
|
*/
|
|
189
|
-
export function lof(
|
|
193
|
+
export function lof(data: any, config: any): any;
|
|
190
194
|
|
|
191
195
|
/**
|
|
192
196
|
* Runs Principal Component Analysis on row-major data.
|
|
@@ -199,14 +203,14 @@ export function lof(data_json: any, config_json: any): any;
|
|
|
199
203
|
* # Output
|
|
200
204
|
* `{ n_components, n_features, eigenvalues, explained_variance_ratio, ... }`
|
|
201
205
|
*/
|
|
202
|
-
export function pca(
|
|
206
|
+
export function pca(data: any, n_components: number): any;
|
|
203
207
|
|
|
204
208
|
/**
|
|
205
209
|
* Runs OLS regression analysis.
|
|
206
210
|
*
|
|
207
211
|
* # Input
|
|
208
212
|
*
|
|
209
|
-
* `
|
|
213
|
+
* `data`:
|
|
210
214
|
* ```json
|
|
211
215
|
* {
|
|
212
216
|
* "predictors": { "x1": [1,2,3,4,5], "x2": [2,4,6,8,10] },
|
|
@@ -219,14 +223,14 @@ export function pca(data_json: any, n_components: number): any;
|
|
|
219
223
|
*
|
|
220
224
|
* `{ target_name, predictor_names, r_squared, adj_r_squared, coefficients, p_values, vif, f_p_value }`
|
|
221
225
|
*/
|
|
222
|
-
export function regression(
|
|
226
|
+
export function regression(data: any): any;
|
|
223
227
|
|
|
224
228
|
/**
|
|
225
229
|
* Computes silhouette scores for an existing clustering assignment.
|
|
226
230
|
*
|
|
227
231
|
* # Input
|
|
228
|
-
* `
|
|
229
|
-
* `
|
|
232
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
233
|
+
* `labels`: cluster id per sample `[0, 0, 1, 1, ...]` (each value `< k`)
|
|
230
234
|
* `k`: number of distinct clusters
|
|
231
235
|
*
|
|
232
236
|
* # Output
|
|
@@ -236,7 +240,7 @@ export function regression(data_json: any): any;
|
|
|
236
240
|
*
|
|
237
241
|
* O(n²) — use sparingly on very large inputs.
|
|
238
242
|
*/
|
|
239
|
-
export function silhouette(
|
|
243
|
+
export function silhouette(data: any, labels: any, k: number): any;
|
|
240
244
|
|
|
241
245
|
/**
|
|
242
246
|
* Variance Inflation Factor diagnostics for column-major numeric data.
|
|
@@ -250,4 +254,4 @@ export function silhouette(data_json: any, labels_json: any, k: number): any;
|
|
|
250
254
|
* # Output
|
|
251
255
|
* `{ vif_per_column, high_vif_columns, threshold, names }`
|
|
252
256
|
*/
|
|
253
|
-
export function vif_diagnostic(
|
|
257
|
+
export function vif_diagnostic(data: any): any;
|
package/u_insight.js
CHANGED
package/u_insight_bg.js
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Standard threshold: `cond > 30` indicates multicollinearity (Belsley 1991).
|
|
13
13
|
* Returns `Infinity` for numerically singular input.
|
|
14
|
-
* @param {any}
|
|
14
|
+
* @param {any} data
|
|
15
15
|
* @returns {any}
|
|
16
16
|
*/
|
|
17
|
-
export function condition_number_diagnostic(
|
|
18
|
-
const ret = wasm.condition_number_diagnostic(
|
|
17
|
+
export function condition_number_diagnostic(data) {
|
|
18
|
+
const ret = wasm.condition_number_diagnostic(data);
|
|
19
19
|
if (ret[2]) {
|
|
20
20
|
throw takeFromExternrefTable0(ret[1]);
|
|
21
21
|
}
|
|
@@ -36,11 +36,11 @@ export function condition_number_diagnostic(data_json) {
|
|
|
36
36
|
*
|
|
37
37
|
* # Output
|
|
38
38
|
* `{ names, matrix (flattened n×n), n, high_pairs }`
|
|
39
|
-
* @param {any}
|
|
39
|
+
* @param {any} data
|
|
40
40
|
* @returns {any}
|
|
41
41
|
*/
|
|
42
|
-
export function correlation_matrix(
|
|
43
|
-
const ret = wasm.correlation_matrix(
|
|
42
|
+
export function correlation_matrix(data) {
|
|
43
|
+
const ret = wasm.correlation_matrix(data);
|
|
44
44
|
if (ret[2]) {
|
|
45
45
|
throw takeFromExternrefTable0(ret[1]);
|
|
46
46
|
}
|
|
@@ -52,19 +52,19 @@ export function correlation_matrix(data_json) {
|
|
|
52
52
|
*
|
|
53
53
|
* # Input
|
|
54
54
|
*
|
|
55
|
-
* `
|
|
55
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
56
56
|
*
|
|
57
|
-
* `
|
|
57
|
+
* `config`: `{ "epsilon": 1.5, "min_samples": 3 }`
|
|
58
58
|
*
|
|
59
59
|
* # Output
|
|
60
60
|
*
|
|
61
61
|
* `{ labels, n_clusters, noise_count, cluster_sizes, core_points }`
|
|
62
|
-
* @param {any}
|
|
63
|
-
* @param {any}
|
|
62
|
+
* @param {any} data
|
|
63
|
+
* @param {any} config
|
|
64
64
|
* @returns {any}
|
|
65
65
|
*/
|
|
66
|
-
export function dbscan(
|
|
67
|
-
const ret = wasm.dbscan(
|
|
66
|
+
export function dbscan(data, config) {
|
|
67
|
+
const ret = wasm.dbscan(data, config);
|
|
68
68
|
if (ret[2]) {
|
|
69
69
|
throw takeFromExternrefTable0(ret[1]);
|
|
70
70
|
}
|
|
@@ -88,11 +88,11 @@ export function dbscan(data_json, config_json) {
|
|
|
88
88
|
*
|
|
89
89
|
* # Output
|
|
90
90
|
* Array of column profile objects, one per column.
|
|
91
|
-
* @param {any}
|
|
91
|
+
* @param {any} data
|
|
92
92
|
* @returns {any}
|
|
93
93
|
*/
|
|
94
|
-
export function describe(
|
|
95
|
-
const ret = wasm.describe(
|
|
94
|
+
export function describe(data) {
|
|
95
|
+
const ret = wasm.describe(data);
|
|
96
96
|
if (ret[2]) {
|
|
97
97
|
throw takeFromExternrefTable0(ret[1]);
|
|
98
98
|
}
|
|
@@ -114,11 +114,11 @@ export function describe(data_json) {
|
|
|
114
114
|
*
|
|
115
115
|
* `method` aliases: `tukey` → IQR Tukey fences (k=1.5), `three_sigma` →
|
|
116
116
|
* mean ± 3·σ, `hampel` → robust median ± 3.5·(MAD/0.6745).
|
|
117
|
-
* @param {any}
|
|
117
|
+
* @param {any} data
|
|
118
118
|
* @returns {any}
|
|
119
119
|
*/
|
|
120
|
-
export function detect_univariate_outliers(
|
|
121
|
-
const ret = wasm.detect_univariate_outliers(
|
|
120
|
+
export function detect_univariate_outliers(data) {
|
|
121
|
+
const ret = wasm.detect_univariate_outliers(data);
|
|
122
122
|
if (ret[2]) {
|
|
123
123
|
throw takeFromExternrefTable0(ret[1]);
|
|
124
124
|
}
|
|
@@ -130,21 +130,25 @@ export function detect_univariate_outliers(data_json) {
|
|
|
130
130
|
*
|
|
131
131
|
* # Input
|
|
132
132
|
*
|
|
133
|
-
* `
|
|
133
|
+
* `data`: flat array `[1.0, 2.0, 3.0, ...]`
|
|
134
134
|
*
|
|
135
|
-
* `
|
|
136
|
-
* "
|
|
137
|
-
* "fit_distributions": false }`
|
|
135
|
+
* `config`: `{ "bin_method": "freedman_diaconis", "bins": null,
|
|
136
|
+
* "significance_level": 0.05, "compute_ecdf": true, "compute_histogram": true,
|
|
137
|
+
* "compute_qq_plot": true, "fit_distributions": false }`
|
|
138
|
+
*
|
|
139
|
+
* `bins` (optional, >= 1): explicit histogram bin count; when set it takes
|
|
140
|
+
* precedence over `bin_method`. The histogram `method` field echoes
|
|
141
|
+
* `"Fixed(n)"` in that case.
|
|
138
142
|
*
|
|
139
143
|
* # Output
|
|
140
144
|
*
|
|
141
145
|
* `{ n, ecdf, histogram, qq_plot, normality, fits }`
|
|
142
|
-
* @param {any}
|
|
143
|
-
* @param {any}
|
|
146
|
+
* @param {any} data
|
|
147
|
+
* @param {any} config
|
|
144
148
|
* @returns {any}
|
|
145
149
|
*/
|
|
146
|
-
export function distribution_analysis(
|
|
147
|
-
const ret = wasm.distribution_analysis(
|
|
150
|
+
export function distribution_analysis(data, config) {
|
|
151
|
+
const ret = wasm.distribution_analysis(data, config);
|
|
148
152
|
if (ret[2]) {
|
|
149
153
|
throw takeFromExternrefTable0(ret[1]);
|
|
150
154
|
}
|
|
@@ -156,7 +160,7 @@ export function distribution_analysis(data_json, config_json) {
|
|
|
156
160
|
*
|
|
157
161
|
* # Input
|
|
158
162
|
*
|
|
159
|
-
* `
|
|
163
|
+
* `data`:
|
|
160
164
|
* ```json
|
|
161
165
|
* {
|
|
162
166
|
* "features": { "f1": [1,2,3,4,5], "f2": [5,4,3,2,1] },
|
|
@@ -173,11 +177,11 @@ export function distribution_analysis(data_json, config_json) {
|
|
|
173
177
|
* # Output
|
|
174
178
|
*
|
|
175
179
|
* `{ method, features: [{ name, index, score, std_dev?, p_value? }], baseline_score?, selected_indices? }`
|
|
176
|
-
* @param {any}
|
|
180
|
+
* @param {any} data
|
|
177
181
|
* @returns {any}
|
|
178
182
|
*/
|
|
179
|
-
export function feature_importance(
|
|
180
|
-
const ret = wasm.feature_importance(
|
|
183
|
+
export function feature_importance(data) {
|
|
184
|
+
const ret = wasm.feature_importance(data);
|
|
181
185
|
if (ret[2]) {
|
|
182
186
|
throw takeFromExternrefTable0(ret[1]);
|
|
183
187
|
}
|
|
@@ -189,20 +193,20 @@ export function feature_importance(data_json) {
|
|
|
189
193
|
*
|
|
190
194
|
* # Input
|
|
191
195
|
*
|
|
192
|
-
* `
|
|
196
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
193
197
|
*
|
|
194
|
-
* `
|
|
198
|
+
* `config`: `{ "linkage": "ward", "n_clusters": 3 }` or
|
|
195
199
|
* `{ "linkage": "single", "distance_threshold": 5.0 }`
|
|
196
200
|
*
|
|
197
201
|
* # Output
|
|
198
202
|
*
|
|
199
203
|
* `{ merges, labels, n_clusters }`
|
|
200
|
-
* @param {any}
|
|
201
|
-
* @param {any}
|
|
204
|
+
* @param {any} data
|
|
205
|
+
* @param {any} config
|
|
202
206
|
* @returns {any}
|
|
203
207
|
*/
|
|
204
|
-
export function hierarchical(
|
|
205
|
-
const ret = wasm.hierarchical(
|
|
208
|
+
export function hierarchical(data, config) {
|
|
209
|
+
const ret = wasm.hierarchical(data, config);
|
|
206
210
|
if (ret[2]) {
|
|
207
211
|
throw takeFromExternrefTable0(ret[1]);
|
|
208
212
|
}
|
|
@@ -214,19 +218,19 @@ export function hierarchical(data_json, config_json) {
|
|
|
214
218
|
*
|
|
215
219
|
* # Input
|
|
216
220
|
*
|
|
217
|
-
* `
|
|
221
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
218
222
|
*
|
|
219
|
-
* `
|
|
223
|
+
* `config`: `{ "n_estimators": 100, "contamination": 0.1, "seed": 42 }`
|
|
220
224
|
*
|
|
221
225
|
* # Output
|
|
222
226
|
*
|
|
223
227
|
* `{ scores, anomalies, threshold, anomaly_count, anomaly_fraction }`
|
|
224
|
-
* @param {any}
|
|
225
|
-
* @param {any}
|
|
228
|
+
* @param {any} data
|
|
229
|
+
* @param {any} config
|
|
226
230
|
* @returns {any}
|
|
227
231
|
*/
|
|
228
|
-
export function isolation_forest(
|
|
229
|
-
const ret = wasm.isolation_forest(
|
|
232
|
+
export function isolation_forest(data, config) {
|
|
233
|
+
const ret = wasm.isolation_forest(data, config);
|
|
230
234
|
if (ret[2]) {
|
|
231
235
|
throw takeFromExternrefTable0(ret[1]);
|
|
232
236
|
}
|
|
@@ -243,12 +247,12 @@ export function isolation_forest(data_json, config_json) {
|
|
|
243
247
|
*
|
|
244
248
|
* # Output
|
|
245
249
|
* `{ k, labels, centroids, wcss, iterations, cluster_sizes }`
|
|
246
|
-
* @param {any}
|
|
250
|
+
* @param {any} data
|
|
247
251
|
* @param {number} k
|
|
248
252
|
* @returns {any}
|
|
249
253
|
*/
|
|
250
|
-
export function kmeans(
|
|
251
|
-
const ret = wasm.kmeans(
|
|
254
|
+
export function kmeans(data, k) {
|
|
255
|
+
const ret = wasm.kmeans(data, k);
|
|
252
256
|
if (ret[2]) {
|
|
253
257
|
throw takeFromExternrefTable0(ret[1]);
|
|
254
258
|
}
|
|
@@ -260,19 +264,19 @@ export function kmeans(data_json, k) {
|
|
|
260
264
|
*
|
|
261
265
|
* # Input
|
|
262
266
|
*
|
|
263
|
-
* `
|
|
267
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
264
268
|
*
|
|
265
|
-
* `
|
|
269
|
+
* `config`: `{ "k": 20, "threshold": 1.5 }`
|
|
266
270
|
*
|
|
267
271
|
* # Output
|
|
268
272
|
*
|
|
269
273
|
* `{ scores, anomalies, threshold, anomaly_count, anomaly_fraction }`
|
|
270
|
-
* @param {any}
|
|
271
|
-
* @param {any}
|
|
274
|
+
* @param {any} data
|
|
275
|
+
* @param {any} config
|
|
272
276
|
* @returns {any}
|
|
273
277
|
*/
|
|
274
|
-
export function lof(
|
|
275
|
-
const ret = wasm.lof(
|
|
278
|
+
export function lof(data, config) {
|
|
279
|
+
const ret = wasm.lof(data, config);
|
|
276
280
|
if (ret[2]) {
|
|
277
281
|
throw takeFromExternrefTable0(ret[1]);
|
|
278
282
|
}
|
|
@@ -289,12 +293,12 @@ export function lof(data_json, config_json) {
|
|
|
289
293
|
*
|
|
290
294
|
* # Output
|
|
291
295
|
* `{ n_components, n_features, eigenvalues, explained_variance_ratio, ... }`
|
|
292
|
-
* @param {any}
|
|
296
|
+
* @param {any} data
|
|
293
297
|
* @param {number} n_components
|
|
294
298
|
* @returns {any}
|
|
295
299
|
*/
|
|
296
|
-
export function pca(
|
|
297
|
-
const ret = wasm.pca(
|
|
300
|
+
export function pca(data, n_components) {
|
|
301
|
+
const ret = wasm.pca(data, n_components);
|
|
298
302
|
if (ret[2]) {
|
|
299
303
|
throw takeFromExternrefTable0(ret[1]);
|
|
300
304
|
}
|
|
@@ -306,7 +310,7 @@ export function pca(data_json, n_components) {
|
|
|
306
310
|
*
|
|
307
311
|
* # Input
|
|
308
312
|
*
|
|
309
|
-
* `
|
|
313
|
+
* `data`:
|
|
310
314
|
* ```json
|
|
311
315
|
* {
|
|
312
316
|
* "predictors": { "x1": [1,2,3,4,5], "x2": [2,4,6,8,10] },
|
|
@@ -318,11 +322,11 @@ export function pca(data_json, n_components) {
|
|
|
318
322
|
* # Output
|
|
319
323
|
*
|
|
320
324
|
* `{ target_name, predictor_names, r_squared, adj_r_squared, coefficients, p_values, vif, f_p_value }`
|
|
321
|
-
* @param {any}
|
|
325
|
+
* @param {any} data
|
|
322
326
|
* @returns {any}
|
|
323
327
|
*/
|
|
324
|
-
export function regression(
|
|
325
|
-
const ret = wasm.regression(
|
|
328
|
+
export function regression(data) {
|
|
329
|
+
const ret = wasm.regression(data);
|
|
326
330
|
if (ret[2]) {
|
|
327
331
|
throw takeFromExternrefTable0(ret[1]);
|
|
328
332
|
}
|
|
@@ -333,8 +337,8 @@ export function regression(data_json) {
|
|
|
333
337
|
* Computes silhouette scores for an existing clustering assignment.
|
|
334
338
|
*
|
|
335
339
|
* # Input
|
|
336
|
-
* `
|
|
337
|
-
* `
|
|
340
|
+
* `data`: row-major points `[[x,y,...], ...]`
|
|
341
|
+
* `labels`: cluster id per sample `[0, 0, 1, 1, ...]` (each value `< k`)
|
|
338
342
|
* `k`: number of distinct clusters
|
|
339
343
|
*
|
|
340
344
|
* # Output
|
|
@@ -343,13 +347,13 @@ export function regression(data_json) {
|
|
|
343
347
|
* (0.0 for singleton-cluster points).
|
|
344
348
|
*
|
|
345
349
|
* O(n²) — use sparingly on very large inputs.
|
|
346
|
-
* @param {any}
|
|
347
|
-
* @param {any}
|
|
350
|
+
* @param {any} data
|
|
351
|
+
* @param {any} labels
|
|
348
352
|
* @param {number} k
|
|
349
353
|
* @returns {any}
|
|
350
354
|
*/
|
|
351
|
-
export function silhouette(
|
|
352
|
-
const ret = wasm.silhouette(
|
|
355
|
+
export function silhouette(data, labels, k) {
|
|
356
|
+
const ret = wasm.silhouette(data, labels, k);
|
|
353
357
|
if (ret[2]) {
|
|
354
358
|
throw takeFromExternrefTable0(ret[1]);
|
|
355
359
|
}
|
|
@@ -367,21 +371,21 @@ export function silhouette(data_json, labels_json, k) {
|
|
|
367
371
|
*
|
|
368
372
|
* # Output
|
|
369
373
|
* `{ vif_per_column, high_vif_columns, threshold, names }`
|
|
370
|
-
* @param {any}
|
|
374
|
+
* @param {any} data
|
|
371
375
|
* @returns {any}
|
|
372
376
|
*/
|
|
373
|
-
export function vif_diagnostic(
|
|
374
|
-
const ret = wasm.vif_diagnostic(
|
|
377
|
+
export function vif_diagnostic(data) {
|
|
378
|
+
const ret = wasm.vif_diagnostic(data);
|
|
375
379
|
if (ret[2]) {
|
|
376
380
|
throw takeFromExternrefTable0(ret[1]);
|
|
377
381
|
}
|
|
378
382
|
return takeFromExternrefTable0(ret[0]);
|
|
379
383
|
}
|
|
380
|
-
export function
|
|
384
|
+
export function __wbg_Error_ef53bc310eb298a0(arg0, arg1) {
|
|
381
385
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
382
386
|
return ret;
|
|
383
387
|
}
|
|
384
|
-
export function
|
|
388
|
+
export function __wbg_Number_6b506e6536831eaa(arg0) {
|
|
385
389
|
const ret = Number(arg0);
|
|
386
390
|
return ret;
|
|
387
391
|
}
|
|
@@ -392,60 +396,60 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
|
392
396
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
393
397
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
394
398
|
}
|
|
395
|
-
export function
|
|
399
|
+
export function __wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d(arg0, arg1) {
|
|
396
400
|
const v = arg1;
|
|
397
401
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
398
402
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
399
403
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
400
404
|
}
|
|
401
|
-
export function
|
|
405
|
+
export function __wbg___wbindgen_boolean_get_1a45e2c38d4d41b9(arg0) {
|
|
402
406
|
const v = arg0;
|
|
403
407
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
404
408
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
405
409
|
}
|
|
406
|
-
export function
|
|
410
|
+
export function __wbg___wbindgen_debug_string_0accd80f45e5faa2(arg0, arg1) {
|
|
407
411
|
const ret = debugString(arg1);
|
|
408
412
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
409
413
|
const len1 = WASM_VECTOR_LEN;
|
|
410
414
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
411
415
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
412
416
|
}
|
|
413
|
-
export function
|
|
417
|
+
export function __wbg___wbindgen_in_70a403a56e771704(arg0, arg1) {
|
|
414
418
|
const ret = arg0 in arg1;
|
|
415
419
|
return ret;
|
|
416
420
|
}
|
|
417
|
-
export function
|
|
421
|
+
export function __wbg___wbindgen_is_bigint_6ffd6468a9bc44b9(arg0) {
|
|
418
422
|
const ret = typeof(arg0) === 'bigint';
|
|
419
423
|
return ret;
|
|
420
424
|
}
|
|
421
|
-
export function
|
|
425
|
+
export function __wbg___wbindgen_is_function_754e9f305ff6029e(arg0) {
|
|
422
426
|
const ret = typeof(arg0) === 'function';
|
|
423
427
|
return ret;
|
|
424
428
|
}
|
|
425
|
-
export function
|
|
429
|
+
export function __wbg___wbindgen_is_object_56732c2bc353f41d(arg0) {
|
|
426
430
|
const val = arg0;
|
|
427
431
|
const ret = typeof(val) === 'object' && val !== null;
|
|
428
432
|
return ret;
|
|
429
433
|
}
|
|
430
|
-
export function
|
|
434
|
+
export function __wbg___wbindgen_is_undefined_67b456be8673d3d7(arg0) {
|
|
431
435
|
const ret = arg0 === undefined;
|
|
432
436
|
return ret;
|
|
433
437
|
}
|
|
434
|
-
export function
|
|
438
|
+
export function __wbg___wbindgen_jsval_eq_1068e624fa87f6ab(arg0, arg1) {
|
|
435
439
|
const ret = arg0 === arg1;
|
|
436
440
|
return ret;
|
|
437
441
|
}
|
|
438
|
-
export function
|
|
442
|
+
export function __wbg___wbindgen_jsval_loose_eq_2c56564c75129511(arg0, arg1) {
|
|
439
443
|
const ret = arg0 == arg1;
|
|
440
444
|
return ret;
|
|
441
445
|
}
|
|
442
|
-
export function
|
|
446
|
+
export function __wbg___wbindgen_number_get_9bb1761122181af2(arg0, arg1) {
|
|
443
447
|
const obj = arg1;
|
|
444
448
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
445
449
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
446
450
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
447
451
|
}
|
|
448
|
-
export function
|
|
452
|
+
export function __wbg___wbindgen_string_get_72bdf95d3ae505b1(arg0, arg1) {
|
|
449
453
|
const obj = arg1;
|
|
450
454
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
451
455
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -453,30 +457,30 @@ export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
|
|
|
453
457
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
454
458
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
455
459
|
}
|
|
456
|
-
export function
|
|
460
|
+
export function __wbg___wbindgen_throw_1506f2235d1bdba0(arg0, arg1) {
|
|
457
461
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
458
462
|
}
|
|
459
|
-
export function
|
|
463
|
+
export function __wbg_call_8a89609d89f6608a() { return handleError(function (arg0, arg1) {
|
|
460
464
|
const ret = arg0.call(arg1);
|
|
461
465
|
return ret;
|
|
462
466
|
}, arguments); }
|
|
463
|
-
export function
|
|
467
|
+
export function __wbg_done_60cf307fcc680536(arg0) {
|
|
464
468
|
const ret = arg0.done;
|
|
465
469
|
return ret;
|
|
466
470
|
}
|
|
467
|
-
export function
|
|
471
|
+
export function __wbg_entries_04b37a02507f1713(arg0) {
|
|
468
472
|
const ret = Object.entries(arg0);
|
|
469
473
|
return ret;
|
|
470
474
|
}
|
|
471
|
-
export function
|
|
475
|
+
export function __wbg_get_1f8f054ddbaa7db2() { return handleError(function (arg0, arg1) {
|
|
472
476
|
const ret = Reflect.get(arg0, arg1);
|
|
473
477
|
return ret;
|
|
474
478
|
}, arguments); }
|
|
475
|
-
export function
|
|
479
|
+
export function __wbg_get_2b48c7d0d006a781(arg0, arg1) {
|
|
476
480
|
const ret = arg0[arg1 >>> 0];
|
|
477
481
|
return ret;
|
|
478
482
|
}
|
|
479
|
-
export function
|
|
483
|
+
export function __wbg_get_unchecked_33f6e5c9e2f2d6b2(arg0, arg1) {
|
|
480
484
|
const ret = arg0[arg1 >>> 0];
|
|
481
485
|
return ret;
|
|
482
486
|
}
|
|
@@ -484,7 +488,7 @@ export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
|
|
|
484
488
|
const ret = arg0[arg1];
|
|
485
489
|
return ret;
|
|
486
490
|
}
|
|
487
|
-
export function
|
|
491
|
+
export function __wbg_instanceof_ArrayBuffer_8f49811467741499(arg0) {
|
|
488
492
|
let result;
|
|
489
493
|
try {
|
|
490
494
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -494,7 +498,7 @@ export function __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6(arg0) {
|
|
|
494
498
|
const ret = result;
|
|
495
499
|
return ret;
|
|
496
500
|
}
|
|
497
|
-
export function
|
|
501
|
+
export function __wbg_instanceof_Map_9fc06d9a951bcee6(arg0) {
|
|
498
502
|
let result;
|
|
499
503
|
try {
|
|
500
504
|
result = arg0 instanceof Map;
|
|
@@ -504,7 +508,7 @@ export function __wbg_instanceof_Map_f194b366846aca0c(arg0) {
|
|
|
504
508
|
const ret = result;
|
|
505
509
|
return ret;
|
|
506
510
|
}
|
|
507
|
-
export function
|
|
511
|
+
export function __wbg_instanceof_Uint8Array_86f30649f63ef9c2(arg0) {
|
|
508
512
|
let result;
|
|
509
513
|
try {
|
|
510
514
|
result = arg0 instanceof Uint8Array;
|
|
@@ -514,56 +518,56 @@ export function __wbg_instanceof_Uint8Array_740438561a5b956d(arg0) {
|
|
|
514
518
|
const ret = result;
|
|
515
519
|
return ret;
|
|
516
520
|
}
|
|
517
|
-
export function
|
|
521
|
+
export function __wbg_isArray_67c2c9c4313f4448(arg0) {
|
|
518
522
|
const ret = Array.isArray(arg0);
|
|
519
523
|
return ret;
|
|
520
524
|
}
|
|
521
|
-
export function
|
|
525
|
+
export function __wbg_isSafeInteger_66acec27e09e99a7(arg0) {
|
|
522
526
|
const ret = Number.isSafeInteger(arg0);
|
|
523
527
|
return ret;
|
|
524
528
|
}
|
|
525
|
-
export function
|
|
529
|
+
export function __wbg_iterator_8732428d309e270e() {
|
|
526
530
|
const ret = Symbol.iterator;
|
|
527
531
|
return ret;
|
|
528
532
|
}
|
|
529
|
-
export function
|
|
533
|
+
export function __wbg_length_4a591ecaa01354d9(arg0) {
|
|
530
534
|
const ret = arg0.length;
|
|
531
535
|
return ret;
|
|
532
536
|
}
|
|
533
|
-
export function
|
|
537
|
+
export function __wbg_length_66f1a4b2e9026940(arg0) {
|
|
534
538
|
const ret = arg0.length;
|
|
535
539
|
return ret;
|
|
536
540
|
}
|
|
537
|
-
export function
|
|
541
|
+
export function __wbg_new_578aeef4b6b94378(arg0) {
|
|
538
542
|
const ret = new Uint8Array(arg0);
|
|
539
543
|
return ret;
|
|
540
544
|
}
|
|
541
|
-
export function
|
|
545
|
+
export function __wbg_new_ce1ab61c1c2b300d() {
|
|
546
|
+
const ret = new Object();
|
|
547
|
+
return ret;
|
|
548
|
+
}
|
|
549
|
+
export function __wbg_new_d90091b82fdf5b91() {
|
|
542
550
|
const ret = new Array();
|
|
543
551
|
return ret;
|
|
544
552
|
}
|
|
545
|
-
export function
|
|
546
|
-
const ret =
|
|
553
|
+
export function __wbg_next_9e03acdf51c4960d(arg0) {
|
|
554
|
+
const ret = arg0.next;
|
|
547
555
|
return ret;
|
|
548
556
|
}
|
|
549
|
-
export function
|
|
557
|
+
export function __wbg_next_eb8ca7351fa27906() { return handleError(function (arg0) {
|
|
550
558
|
const ret = arg0.next();
|
|
551
559
|
return ret;
|
|
552
560
|
}, arguments); }
|
|
553
|
-
export function
|
|
554
|
-
const ret = arg0.next;
|
|
555
|
-
return ret;
|
|
556
|
-
}
|
|
557
|
-
export function __wbg_prototypesetcall_d62e5099504357e6(arg0, arg1, arg2) {
|
|
561
|
+
export function __wbg_prototypesetcall_3249fc62a0fafa30(arg0, arg1, arg2) {
|
|
558
562
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
559
563
|
}
|
|
560
|
-
export function __wbg_set_282384002438957f(arg0, arg1, arg2) {
|
|
561
|
-
arg0[arg1 >>> 0] = arg2;
|
|
562
|
-
}
|
|
563
564
|
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
564
565
|
arg0[arg1] = arg2;
|
|
565
566
|
}
|
|
566
|
-
export function
|
|
567
|
+
export function __wbg_set_dca99999bba88a9a(arg0, arg1, arg2) {
|
|
568
|
+
arg0[arg1 >>> 0] = arg2;
|
|
569
|
+
}
|
|
570
|
+
export function __wbg_value_f3625092ee4b37f4(arg0) {
|
|
567
571
|
const ret = arg0.value;
|
|
568
572
|
return ret;
|
|
569
573
|
}
|
|
@@ -681,8 +685,7 @@ function getDataViewMemory0() {
|
|
|
681
685
|
}
|
|
682
686
|
|
|
683
687
|
function getStringFromWasm0(ptr, len) {
|
|
684
|
-
|
|
685
|
-
return decodeText(ptr, len);
|
|
688
|
+
return decodeText(ptr >>> 0, len);
|
|
686
689
|
}
|
|
687
690
|
|
|
688
691
|
let cachedUint8ArrayMemory0 = null;
|
package/u_insight_bg.wasm
CHANGED
|
Binary file
|