@datagrok/eda 1.1.6 → 1.1.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/dist/100.js +2 -0
- package/dist/111.js +2 -2
- package/dist/118.js +2 -0
- package/dist/146.js +2 -2
- package/dist/155.js +2 -2
- package/dist/221.js +2 -2
- package/dist/313.js +2 -0
- package/dist/355.js +2 -2
- package/dist/356.js +2 -0
- package/dist/44.js +2 -0
- package/dist/471.js +2 -0
- package/dist/489.js +3 -0
- package/dist/489.js.LICENSE.txt +51 -0
- package/dist/584.js +2 -2
- package/dist/604.js +2 -2
- package/dist/632.js +2 -2
- package/dist/645.js +2 -2
- package/dist/656.js +2 -0
- package/dist/664.js +2 -0
- package/dist/694.js +2 -2
- package/dist/727.js +2 -0
- package/dist/729.js +2 -2
- package/dist/796.js +2 -0
- package/dist/8473fcbfb6e85ca6c852.wasm +0 -0
- package/dist/861.js +2 -0
- package/dist/93.js +2 -2
- package/dist/972.js +2 -0
- package/dist/9a8fbf37666e32487835.wasm +0 -0
- package/dist/package-test.js +2 -2
- package/dist/package.js +2 -2
- package/package.json +34 -3
- package/src/package.ts +63 -45
- package/dist/80.js +0 -2
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/eda",
|
|
3
3
|
"friendlyName": "EDA",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.8",
|
|
5
5
|
"description": "Exploratory Data Analysis Tools",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@datagrok-libraries/ml": "^6.3.
|
|
7
|
+
"@datagrok-libraries/ml": "^6.3.70",
|
|
8
8
|
"@datagrok-libraries/tutorials": "^1.3.6",
|
|
9
9
|
"@datagrok-libraries/utils": "^4.1.4",
|
|
10
|
+
"@datagrok-libraries/math": "^1.0.7",
|
|
10
11
|
"@keckelt/tsne": "^1.0.2",
|
|
11
12
|
"cash-dom": "^8.1.1",
|
|
12
13
|
"datagrok-api": "^1.16.0",
|
|
@@ -50,5 +51,35 @@
|
|
|
50
51
|
"category": "Machine Learning",
|
|
51
52
|
"sources": [
|
|
52
53
|
"wasm/EDA.js"
|
|
53
|
-
]
|
|
54
|
+
],
|
|
55
|
+
"meta": {
|
|
56
|
+
"menu": {
|
|
57
|
+
"ML": {
|
|
58
|
+
"Tools": {
|
|
59
|
+
"Impute Missing Values...": null,
|
|
60
|
+
"Random Data...": null
|
|
61
|
+
},
|
|
62
|
+
"Cluster": {
|
|
63
|
+
"Cluster...": null,
|
|
64
|
+
"DBSCAN...": null
|
|
65
|
+
},
|
|
66
|
+
"Notebooks": {
|
|
67
|
+
"Browse Notebooks": null,
|
|
68
|
+
"Open in Notebook": null,
|
|
69
|
+
"New Notebook": null
|
|
70
|
+
},
|
|
71
|
+
"Models": {
|
|
72
|
+
"Browse Models": null,
|
|
73
|
+
"Train Model...": null,
|
|
74
|
+
"Apply Model...": null
|
|
75
|
+
},
|
|
76
|
+
"Analyse": {
|
|
77
|
+
"PCA...": null,
|
|
78
|
+
"ANOVA...": null,
|
|
79
|
+
"Multivariate Analysis...": null
|
|
80
|
+
},
|
|
81
|
+
"Reduce Dimensionality": null
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
54
85
|
}
|
package/src/package.ts
CHANGED
|
@@ -14,6 +14,15 @@ import {LINEAR, RBF, POLYNOMIAL, SIGMOID,
|
|
|
14
14
|
getTrainedModel, getPrediction, showTrainReport, getPackedModel} from './svm';
|
|
15
15
|
|
|
16
16
|
import {oneWayAnova} from './stat-tools';
|
|
17
|
+
import { getDbscanWorker } from '@datagrok-libraries/math';
|
|
18
|
+
|
|
19
|
+
import {DistanceAggregationMethods} from '@datagrok-libraries/ml/src/distance-matrix/types';
|
|
20
|
+
import {MultiColumnDimReductionEditor} from
|
|
21
|
+
'@datagrok-libraries/ml/src/multi-column-dimensionality-reduction/multi-column-dim-reduction-editor';
|
|
22
|
+
import {multiColReduceDimensionality} from
|
|
23
|
+
'@datagrok-libraries/ml/src/multi-column-dimensionality-reduction/reduce-dimensionality';
|
|
24
|
+
import { DimReductionMethods } from '@datagrok-libraries/ml/src/reduce-dimensionality';
|
|
25
|
+
import { KnownMetrics } from '@datagrok-libraries/ml/src/typed-metrics';
|
|
17
26
|
|
|
18
27
|
export const _package = new DG.Package();
|
|
19
28
|
|
|
@@ -27,7 +36,24 @@ export async function init(): Promise<void> {
|
|
|
27
36
|
await _initEDAAPI();
|
|
28
37
|
}
|
|
29
38
|
|
|
30
|
-
//top-menu: ML |
|
|
39
|
+
//top-menu: ML | Cluster | DBSCAN...
|
|
40
|
+
//name: DBSCAN
|
|
41
|
+
//description: Density-based spatial clustering of applications with noise (DBSCAN)
|
|
42
|
+
//input: dataframe df
|
|
43
|
+
//input: column xCol {type: numerical}
|
|
44
|
+
//input: column yCol {type: numerical}
|
|
45
|
+
//input: double epsilon = 0.02 {caption: Epsilon} [The maximum distance between two samples for them to be considered as in the same neighborhood.]
|
|
46
|
+
//input: int minPts = 4 {caption: Minimum points} [The number of samples (or total weight) in a neighborhood for a point to be considered as a core point.]
|
|
47
|
+
export async function dbScan(df: DG.DataFrame, xCol: DG.Column, yCol: DG.Column, epsilon: number, minPts: number) {
|
|
48
|
+
const x = xCol.getRawData() as Float32Array;
|
|
49
|
+
const y = yCol.getRawData() as Float32Array;
|
|
50
|
+
const res = await getDbscanWorker(x, y, epsilon, minPts);
|
|
51
|
+
const clusterColName = df.columns.getUnusedName('Cluster');
|
|
52
|
+
const cluster = DG.Column.fromInt32Array(clusterColName, res);
|
|
53
|
+
df.columns.add(cluster);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//top-menu: ML | Analyze | PCA...
|
|
31
57
|
//name: PCA
|
|
32
58
|
//description: Principal component analysis (PCA)
|
|
33
59
|
//input: dataframe table
|
|
@@ -44,54 +70,46 @@ export async function PCA(table: DG.DataFrame, features: DG.ColumnList, componen
|
|
|
44
70
|
return pcaTable;
|
|
45
71
|
}
|
|
46
72
|
|
|
47
|
-
|
|
48
|
-
//name:
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//input:
|
|
53
|
-
//input:
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export async function UMAP(table: DG.DataFrame, features: DG.ColumnList, components: number,
|
|
59
|
-
epochs: number, neighbors: number, minDist: number, spread: number): Promise<DG.DataFrame>
|
|
60
|
-
{
|
|
61
|
-
return await computeUMAP(features, components, epochs, neighbors, minDist, spread);
|
|
73
|
+
|
|
74
|
+
//name: None (number)
|
|
75
|
+
//tags: dim-red-preprocessing-function
|
|
76
|
+
//meta.supportedTypes: int,float,double,qnum
|
|
77
|
+
//meta.supportedDistanceFunctions: Difference
|
|
78
|
+
//input: column col
|
|
79
|
+
//input: string _metric {optional: true}
|
|
80
|
+
//output: object result
|
|
81
|
+
export function numberPreprocessingFunction(col: DG.Column, _metric: string) {
|
|
82
|
+
const entries = col.toList();
|
|
83
|
+
return {entries, options: {}};
|
|
62
84
|
}
|
|
63
85
|
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//input:
|
|
69
|
-
//input:
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export async function tSNE(table: DG.DataFrame, features: DG.ColumnList, components: number,
|
|
75
|
-
learningRate: number, perplexity: number, iterations: number): Promise<DG.DataFrame>
|
|
76
|
-
{
|
|
77
|
-
return await computeTSNE(features, components, learningRate, perplexity, iterations);
|
|
86
|
+
//name: None (string)
|
|
87
|
+
//tags: dim-red-preprocessing-function
|
|
88
|
+
//meta.supportedTypes: string
|
|
89
|
+
//meta.supportedDistanceFunctions: Levenshtein,Hamming,One-Hot
|
|
90
|
+
//input: column col
|
|
91
|
+
//input: string _metric {optional: true}
|
|
92
|
+
//output: object result
|
|
93
|
+
export function stringPreprocessingFunction(col: DG.Column, _metric: string) {
|
|
94
|
+
const entries = col.toList();
|
|
95
|
+
return {entries, options: {}};
|
|
78
96
|
}
|
|
79
97
|
|
|
80
|
-
//top-menu: ML | Dimensionality
|
|
81
|
-
//name:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
//top-menu: ML | Reduce Dimensionality...
|
|
99
|
+
//name: Multi Column Dimensionality Reduction
|
|
100
|
+
export async function reduceDimensionality(): Promise<void> {
|
|
101
|
+
const editor = new MultiColumnDimReductionEditor();
|
|
102
|
+
ui.dialog('Dimensionality reduction').add(editor.getEditor()).onOK(async () => {
|
|
103
|
+
const params = editor.getParams();
|
|
104
|
+
if (params.columns.length === 0)
|
|
105
|
+
return;
|
|
106
|
+
await multiColReduceDimensionality(params.table, params.columns, params.methodName as DimReductionMethods,
|
|
107
|
+
params.distanceMetrics as KnownMetrics[],
|
|
108
|
+
params.weights, params.preprocessingFunctions, params.aggreaggregationMethod as DistanceAggregationMethods,
|
|
109
|
+
!!params.plotEmbeddings, !!params.clusterEmbeddings, params.options, {
|
|
110
|
+
fastRowCount: 10000,
|
|
111
|
+
});
|
|
112
|
+
}).show();
|
|
95
113
|
}
|
|
96
114
|
|
|
97
115
|
//top-menu: ML | Analyze | Multivariate Analysis...
|