@datagrok/eda 1.1.0 → 1.1.2

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,14 +1,14 @@
1
1
  {
2
2
  "name": "@datagrok/eda",
3
3
  "friendlyName": "EDA",
4
- "version": "1.1.0",
4
+ "version": "1.1.2",
5
5
  "description": "Exploratory Data Analysis Tools",
6
6
  "dependencies": {
7
7
  "datagrok-api": "latest",
8
8
  "cash-dom": "latest",
9
9
  "dayjs": "latest",
10
10
  "@datagrok-libraries/utils": "latest",
11
- "@datagrok-libraries/tutorials": "^1.3.3"
11
+ "@datagrok-libraries/tutorials": "^1.3.6"
12
12
  },
13
13
  "author": {
14
14
  "name": "Viktor Makarichev",
@@ -47,4 +47,4 @@
47
47
  "sources": [
48
48
  "wasm/EDA.js"
49
49
  ]
50
- }
50
+ }
@@ -1,12 +1,15 @@
1
1
  import * as DG from "datagrok-api/dg";
2
- import {runTests, tests} from '@datagrok-libraries/utils/src/test';
2
+ import {runTests, tests, TestContext} from '@datagrok-libraries/utils/src/test';
3
3
 
4
4
  export let _package = new DG.Package();
5
5
  export {tests};
6
6
 
7
7
  //name: test
8
+ //input: string category {optional: true}
9
+ //input: string test {optional: true}
10
+ //input: object testContext {optional: true}
8
11
  //output: dataframe result
9
- export async function test(): Promise<DG.DataFrame> {
10
- let data = await runTests();
12
+ export async function test(category: string, test: string, testContext: TestContext): Promise<DG.DataFrame> {
13
+ const data = await runTests({category, test, testContext});
11
14
  return DG.DataFrame.fromObjects(data)!;
12
15
  }
package/src/package.ts CHANGED
@@ -29,7 +29,7 @@ export async function init(): Promise<void> {
29
29
  //name: PCA
30
30
  //description: Principal component analysis (PCA).
31
31
  //input: dataframe table
32
- //input: column_list features
32
+ //input: column_list features {type: numerical}
33
33
  //input: int components = 2
34
34
  //input: bool center = true
35
35
  //input: bool scale = true
@@ -40,13 +40,13 @@ export async function PCA(table: DG.DataFrame, features: DG.ColumnList, componen
40
40
  return renamePCAcolumns(await computePCA(table, features, components, center, scale));
41
41
  }
42
42
 
43
- //top-menu: Tools | Data Science | Multivariate Analysis (PLS)...
43
+ //top-menu: ML | Multivariate Analysis (PLS)...
44
44
  //name: Multivariate Analysis (PLS)
45
- //description: Partial least square regression (PLS).
45
+ //description: Multidimensional data analysis using partial least squares (PLS) regression. It reduces the predictors to a smaller set of uncorrelated components and performs least squares regression on them.
46
46
  //input: dataframe table
47
47
  //input: column names
48
- //input: column_list features
49
- //input: column predict
48
+ //input: column_list features {type: numerical}
49
+ //input: column predict {type: numerical}
50
50
  //input: int components = 3
51
51
  export async function PLS(table: DG.DataFrame, names: DG.Column, features: DG.ColumnList,
52
52
  predict: DG.Column, components: number): Promise<void>
package/wasm/callWasm.js CHANGED
@@ -397,9 +397,6 @@ let Return = {
397
397
 
398
398
  // The main tool that combines all together
399
399
  export function callWasm(module, funcName, inputs) {
400
-
401
- let start = new Date().getTime();
402
-
403
400
  // get specification of exported C/C++-function
404
401
  let funcSpecification = module[funcName];
405
402
 
@@ -449,18 +446,12 @@ export function callWasm(module, funcName, inputs) {
449
446
  // CALL EXPORTED CPP-FUNCTION
450
447
  let callResult = cppFuncWrapper(module, funcName, 'num', cppFuncInput);
451
448
 
452
- console.log('C++-function call result: ' + callResult);
453
-
454
449
  // store result that is returned by exported cpp-function
455
450
  args._callResult = Param.num(callResult);
456
451
 
457
452
  // create output
458
453
  let output = funcSpecification.output;
459
454
 
460
- let finish = new Date().getTime();
461
-
462
- console.log(`Time for C/C++-function is ${finish - start} ms.`)
463
-
464
455
  // if a single object must be returned
465
456
  if(output['type'] != 'objects')
466
457
  return Return[output['type']](args[output['source']].data);