@datagrok/eda 1.2.4 → 1.2.6

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/package.json CHANGED
@@ -1 +1,96 @@
1
- {"name": "@datagrok/eda", "friendlyName": "EDA", "version": "1.2.4", "description": "Exploratory Data Analysis Tools", "dependencies": {"@datagrok-libraries/math": "^1.2.0", "@datagrok-libraries/ml": "^6.7.0", "@datagrok-libraries/tutorials": "^1.4.2", "@datagrok-libraries/utils": "^4.3.0", "@keckelt/tsne": "^1.0.2", "@webgpu/types": "^0.1.40", "cash-dom": "^8.1.1", "datagrok-api": "^1.22.0", "dayjs": "^1.11.9", "jstat": "^1.9.6", "source-map-loader": "^4.0.1", "umap-js": "^1.3.3", "worker-loader": "^3.0.8"}, "author": {"name": "Viktor Makarichev", "email": "vmakarichev@datagrok.ai"}, "devDependencies": {"@typescript-eslint/eslint-plugin": "^5.32.0", "@typescript-eslint/parser": "^5.32.0", "css-loader": "^7.1.2", "eslint": "^8.21.0", "eslint-config-google": "^0.14.0", "style-loader": "^4.0.0", "ts-loader": "^9.5.1", "typescript": "^5.6.3", "webpack": "^5.95.0", "webpack-cli": "^5.1.4"}, "scripts": {"link-all": "npm link datagrok-api @datagrok-libraries/utils @datagrok-libraries/tutorials", "debug-eda": "webpack && grok publish", "release-eda": "webpack && grok publish --release", "build-eda": "webpack", "build": "webpack", "test": "grok test", "debug-eda-dev": "webpack && grok publish dev", "release-eda-dev": "webpack && grok publish dev --release", "debug-eda-local": "webpack && grok publish local", "release-eda-local": "webpack && grok publish local --release", "build-all": "npm --prefix ./../../js-api run build && npm --prefix ./../../libraries/utils run build && npm --prefix ./../../libraries/tutorials run build && npm run build"}, "canEdit": ["Developers"], "canView": ["All users"], "repository": {"type": "git", "url": "https://github.com/datagrok-ai/public.git", "directory": "packages/EDA"}, "category": "Machine Learning", "sources": ["wasm/EDA.js", "wasm/XGBoostAPI.js"], "meta": {"menu": {"ML": {"Tools": {"Impute Missing Values...": null, "Random Data...": null}, "Cluster": {"Cluster...": null, "DBSCAN...": null}, "Notebooks": {"Browse Notebooks": null, "Open in Notebook": null, "New Notebook": null}, "Models": {"Browse Models": null, "Train Model...": null, "Apply Model...": null}, "Analyse": {"PCA...": null, "ANOVA...": null, "Multivariate Analysis...": null}, "Reduce Dimensionality": null}}}}
1
+ {
2
+ "name": "@datagrok/eda",
3
+ "friendlyName": "EDA",
4
+ "version": "1.2.6",
5
+ "description": "Exploratory Data Analysis Tools",
6
+ "dependencies": {
7
+ "@datagrok-libraries/math": "^1.2.0",
8
+ "@datagrok-libraries/ml": "^6.7.0",
9
+ "@datagrok-libraries/tutorials": "^1.4.2",
10
+ "@datagrok-libraries/utils": "^4.3.0",
11
+ "@keckelt/tsne": "^1.0.2",
12
+ "@webgpu/types": "^0.1.40",
13
+ "cash-dom": "^8.1.1",
14
+ "datagrok-api": "^1.22.0",
15
+ "dayjs": "^1.11.9",
16
+ "jstat": "^1.9.6",
17
+ "source-map-loader": "^4.0.1",
18
+ "umap-js": "^1.3.3",
19
+ "worker-loader": "^3.0.8"
20
+ },
21
+ "author": {
22
+ "name": "Viktor Makarichev",
23
+ "email": "vmakarichev@datagrok.ai"
24
+ },
25
+ "devDependencies": {
26
+ "@typescript-eslint/eslint-plugin": "^5.32.0",
27
+ "@typescript-eslint/parser": "^5.32.0",
28
+ "css-loader": "^7.1.2",
29
+ "eslint": "^8.21.0",
30
+ "eslint-config-google": "^0.14.0",
31
+ "style-loader": "^4.0.0",
32
+ "ts-loader": "^9.5.1",
33
+ "typescript": "^5.6.3",
34
+ "webpack": "^5.95.0",
35
+ "webpack-cli": "^5.1.4"
36
+ },
37
+ "scripts": {
38
+ "link-all": "npm link datagrok-api @datagrok-libraries/utils @datagrok-libraries/tutorials",
39
+ "debug-eda": "webpack && grok publish",
40
+ "release-eda": "webpack && grok publish --release",
41
+ "build-eda": "webpack",
42
+ "build": "webpack",
43
+ "test": "grok test",
44
+ "debug-eda-dev": "webpack && grok publish dev",
45
+ "release-eda-dev": "webpack && grok publish dev --release",
46
+ "debug-eda-local": "webpack && grok publish local",
47
+ "release-eda-local": "webpack && grok publish local --release",
48
+ "build-all": "npm --prefix ./../../js-api run build && npm --prefix ./../../libraries/utils run build && npm --prefix ./../../libraries/tutorials run build && npm run build"
49
+ },
50
+ "canEdit": [
51
+ "Developers"
52
+ ],
53
+ "canView": [
54
+ "All users"
55
+ ],
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "https://github.com/datagrok-ai/public.git",
59
+ "directory": "packages/EDA"
60
+ },
61
+ "category": "Machine Learning",
62
+ "sources": [
63
+ "wasm/EDA.js",
64
+ "wasm/XGBoostAPI.js"
65
+ ],
66
+ "meta": {
67
+ "menu": {
68
+ "ML": {
69
+ "Tools": {
70
+ "Impute Missing Values...": null,
71
+ "Random Data...": null
72
+ },
73
+ "Cluster": {
74
+ "Cluster...": null,
75
+ "DBSCAN...": null
76
+ },
77
+ "Notebooks": {
78
+ "Browse Notebooks": null,
79
+ "Open in Notebook": null,
80
+ "New Notebook": null
81
+ },
82
+ "Models": {
83
+ "Browse Models": null,
84
+ "Train Model...": null,
85
+ "Apply Model...": null
86
+ },
87
+ "Analyse": {
88
+ "PCA...": null,
89
+ "ANOVA...": null,
90
+ "Multivariate Analysis...": null
91
+ },
92
+ "Reduce Dimensionality": null
93
+ }
94
+ }
95
+ }
96
+ }
@@ -26,7 +26,7 @@ export const COPY_SUFFIX = 'copy';
26
26
 
27
27
  /** UI titles */
28
28
  export enum TITLE {
29
- KNN_IMPUTER = 'KNN Imputation',
29
+ KNN_IMPUTER = 'k-NN Imputation',
30
30
  TABLE = 'Table',
31
31
  IN_PLACE = 'In-place',
32
32
  COLUMNS = 'Impute',
@@ -44,12 +44,12 @@ export enum TITLE {
44
44
  };
45
45
 
46
46
  /** Help links */
47
- export const KNN_IMPUTER = '/help/explore/missing-values-imputation';
47
+ export const KNN_IMPUTER = '/help/explore/missing-values-imputation#the-k-nn-method';
48
48
 
49
49
  /** Tooltips */
50
50
  export enum HINT {
51
51
  TARGET = 'Columns with missing values that must be filled',
52
- FEATURES = "Columns with features to be used for determining the 'nearest' elements in the KNN method",
52
+ FEATURES = "Columns with features to be used for determining the 'nearest' elements in the k-NN method",
53
53
  IN_PLACE = 'Defines whether to use in-place imputation or add a new column without missing values',
54
54
  METRIC = 'Type of metric between the feature values',
55
55
  WEIGHT = 'Weight',
@@ -61,6 +61,7 @@ export enum HINT {
61
61
  FILL_VALUE = 'Fill value',
62
62
  IMPUTATION_SETTINGS = 'Simple imputation settings',
63
63
  KEEP_EMPTY = 'Defines whether to keep empty missing values failed to be imputed OR fill them using simple imputation',
64
+ RUN = 'Run imputation using the k-NN method',
64
65
  };
65
66
 
66
67
  export const MAX_INPUT_NAME_LENGTH = 15;
@@ -275,7 +275,7 @@ export async function runKNNImputer(df?: DG.DataFrame): Promise<void> {
275
275
  grok.shell.error(`${ERROR_MSG.KNN_FAILS}: ${ERROR_MSG.CORE_ISSUE}`);
276
276
  reject(err);
277
277
  }
278
- });
278
+ }, undefined, HINT.RUN);
279
279
 
280
280
  dlg.add(targetColInput)
281
281
  .add(featuresInput)
@@ -36,6 +36,7 @@ export enum TITLE {
36
36
  EXPLORE = 'Explore',
37
37
  FEATURES = 'Feature names',
38
38
  BROWSE = 'Browse',
39
+ ANALYSIS = 'Features Analysis',
39
40
  }
40
41
 
41
42
  /** Tooltips */
@@ -139,15 +139,18 @@ async function performMVA(input: PlsInput, analysisType: PLS_ANALYSIS): Promise<
139
139
  grok.shell.tableView(input.table.name);
140
140
 
141
141
  // 0.1 Buffer table
142
- const buffer = DG.DataFrame.fromColumns([
142
+ const loadingsRegrCoefsTable = DG.DataFrame.fromColumns([
143
143
  DG.Column.fromStrings(TITLE.FEATURE, featuresNames),
144
144
  result.regressionCoefficients,
145
145
  ]);
146
146
 
147
+ loadingsRegrCoefsTable.name = `${input.table.name}(${TITLE.ANALYSIS})`;
148
+ grok.shell.addTable(loadingsRegrCoefsTable);
149
+
147
150
  // 0.2. Add X-Loadings
148
151
  result.xLoadings.forEach((col, idx) => {
149
- col.name = buffer.columns.getUnusedName(`${TITLE.XLOADING}${idx + 1}`);
150
- buffer.columns.add(col);
152
+ col.name = loadingsRegrCoefsTable.columns.getUnusedName(`${TITLE.XLOADING}${idx + 1}`);
153
+ loadingsRegrCoefsTable.columns.add(col);
151
154
  });
152
155
 
153
156
  // 1. Predicted vs Reference scatter plot
@@ -165,12 +168,15 @@ async function performMVA(input: PlsInput, analysisType: PLS_ANALYSIS): Promise<
165
168
  help: LINK.MODEL,
166
169
  }));
167
170
 
171
+ console.log(input.names?.name);
172
+
168
173
  if ((input.names !== undefined) && (input.names !== null))
169
174
  predictVsReferScatter.setOptions({labelFormColumnNames: [input.names?.name]});
170
175
 
171
176
  // 2. Regression Coefficients Bar Chart
172
177
  result.regressionCoefficients.name = TITLE.REGR_COEFS;
173
- const regrCoeffsBar = view.addViewer(DG.Viewer.barChart(buffer, {
178
+ const regrCoeffsBar = view.addViewer(DG.Viewer.barChart(loadingsRegrCoefsTable, {
179
+ table: loadingsRegrCoefsTable.name,
174
180
  title: TITLE.REGR_COEFS,
175
181
  splitColumnName: TITLE.FEATURE,
176
182
  valueColumnName: result.regressionCoefficients.name,
@@ -182,7 +188,8 @@ async function performMVA(input: PlsInput, analysisType: PLS_ANALYSIS): Promise<
182
188
 
183
189
  // 3. Loadings Scatter Plot
184
190
  result.xLoadings.forEach((col, idx) => col.name = `${TITLE.XLOADING}${idx + 1}`);
185
- const loadingsScatter = view.addViewer(DG.Viewer.scatterPlot(buffer, {
191
+ const loadingsScatter = view.addViewer(DG.Viewer.scatterPlot(loadingsRegrCoefsTable, {
192
+ table: loadingsRegrCoefsTable.name,
186
193
  title: TITLE.LOADINGS,
187
194
  xColumnName: `${TITLE.XLOADING}1`,
188
195
  yColumnName: `${TITLE.XLOADING}${result.xLoadings.length > 1 ? '2' : '1'}`,
@@ -212,7 +219,7 @@ async function performMVA(input: PlsInput, analysisType: PLS_ANALYSIS): Promise<
212
219
  });
213
220
 
214
221
  if ((input.names !== undefined) && (input.names !== null))
215
- predictVsReferScatter.setOptions({labelFormColumnNames: [input.names?.name]});
222
+ scoresScatter.setOptions({labelFormColumnNames: [input.names?.name]});
216
223
 
217
224
  // 4.3) create lines & circles
218
225
  scoresScatter.meta.formulaLines.addAll(getLines(scoreNames));
@@ -249,10 +256,14 @@ async function performMVA(input: PlsInput, analysisType: PLS_ANALYSIS): Promise<
249
256
  DG.Column.fromFloat32Array(input.predict.name, yExplVars),
250
257
  ]);
251
258
 
259
+ explVarsDF.name = `${input.table.name}(${TITLE.EXPL_VAR})`;
260
+ grok.shell.addTable(explVarsDF);
261
+
252
262
  xExplVars.forEach((arr, idx) => explVarsDF.columns.add(DG.Column.fromFloat32Array(featuresNames[idx], arr)));
253
263
 
254
264
  // 5.3) bar chart
255
265
  const explVarsBar = view.addViewer(DG.Viewer.barChart(explVarsDF, {
266
+ table: explVarsDF.name,
256
267
  title: TITLE.EXPL_VAR,
257
268
  splitColumnName: TITLE.COMPONENTS,
258
269
  valueColumnName: input.predict.name,
@@ -377,7 +388,7 @@ export async function runMVA(analysisType: PLS_ANALYSIS): Promise<void> {
377
388
  const namesInputs = ui.input.column(TITLE.NAMES, {
378
389
  table: table,
379
390
  value: names,
380
- onValueChanged: () => names = predictInput.value ?? undefined,
391
+ onValueChanged: (value) => names = value ?? undefined,
381
392
  filter: (col: DG.Column) => col.type === DG.COLUMN_TYPE.STRING},
382
393
  );
383
394
  namesInputs.setTooltip(HINT.NAMES);
@@ -388,6 +399,8 @@ export async function runMVA(analysisType: PLS_ANALYSIS): Promise<void> {
388
399
  .addButton(TITLE.RUN, async () => {
389
400
  dlg.close();
390
401
 
402
+ console.log(names);
403
+
391
404
  await performMVA({
392
405
  table: table,
393
406
  features: DG.DataFrame.fromColumns(features).columns,