@datagrok/eda 1.1.6 → 1.1.7
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/356.js +2 -0
- package/dist/796.js +2 -0
- package/dist/8473fcbfb6e85ca6c852.wasm +0 -0
- package/dist/9a8fbf37666e32487835.wasm +0 -0
- package/dist/package.js +2 -2
- package/package.json +2 -1
- package/src/package.ts +18 -0
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.7",
|
|
5
5
|
"description": "Exploratory Data Analysis Tools",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@datagrok-libraries/ml": "^6.3.39",
|
|
8
8
|
"@datagrok-libraries/tutorials": "^1.3.6",
|
|
9
9
|
"@datagrok-libraries/utils": "^4.1.4",
|
|
10
|
+
"@datagrok-libraries/math": "^1.0.3",
|
|
10
11
|
"@keckelt/tsne": "^1.0.2",
|
|
11
12
|
"cash-dom": "^8.1.1",
|
|
12
13
|
"datagrok-api": "^1.16.0",
|
package/src/package.ts
CHANGED
|
@@ -14,6 +14,7 @@ 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';
|
|
17
18
|
|
|
18
19
|
export const _package = new DG.Package();
|
|
19
20
|
|
|
@@ -27,6 +28,23 @@ export async function init(): Promise<void> {
|
|
|
27
28
|
await _initEDAAPI();
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
//top-menu: ML | Cluster | DBSCAN...
|
|
32
|
+
//name: DBSCAN
|
|
33
|
+
//description: Density-based spatial clustering of applications with noise (DBSCAN)
|
|
34
|
+
//input: dataframe df
|
|
35
|
+
//input: column xCol {type: numerical}
|
|
36
|
+
//input: column yCol {type: numerical}
|
|
37
|
+
//input: double epsilon = 0.02 {caption: Epsilon} [The maximum distance between two samples for them to be considered as in the same neighborhood.]
|
|
38
|
+
//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.]
|
|
39
|
+
export async function dbScan(df: DG.DataFrame, xCol: DG.Column, yCol: DG.Column, epsilon: number, minPts: number) {
|
|
40
|
+
const x = xCol.getRawData() as Float32Array;
|
|
41
|
+
const y = yCol.getRawData() as Float32Array;
|
|
42
|
+
const res = await getDbscanWorker(x, y, epsilon, minPts);
|
|
43
|
+
const clusterColName = df.columns.getUnusedName('Cluster');
|
|
44
|
+
const cluster = DG.Column.fromInt32Array(clusterColName, res);
|
|
45
|
+
df.columns.add(cluster);
|
|
46
|
+
}
|
|
47
|
+
|
|
30
48
|
//top-menu: ML | Dimensionality Reduction | PCA...
|
|
31
49
|
//name: PCA
|
|
32
50
|
//description: Principal component analysis (PCA)
|