-
Notifications
You must be signed in to change notification settings - Fork 37
/
interfaces.ts
74 lines (65 loc) · 1.95 KB
/
interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*!
* Copyright (c) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project.
*/
import { DatasetManager } from '../dataset'
import { DatasetTransform } from '../interfaces'
export interface DistributionBuilder {
build(ds: DatasetManager): any
}
/**
* The density transform generates a new data stream of uniformly-spaced
* samples drawn from a one-dimensional probability density function (pdf) or
* cumulative distribution function (cdf). This transform is useful for
* representing probability distributions and generating continuous
* distributions from discrete samples using kernel density estimation.
*/
export interface DensityBuilder extends DatasetTransform {
/**
* Required. An object describing the distribution type and parameters.
* See the distribution reference for more.
*
* @param dist
*/
distribution(dist: DistributionBuilder): DensityBuilder
/**
* A [min, max] domain from which to sample the distribution. This argument
* is required in most cases, but can be omitted in the case of
* distributions (namely, kde) that can deduce their own extent.
*
* @param start
* @param end
*/
extent(start: number, end: number): DensityBuilder
/**
* The type of distribution to generate.
* @param value
*/
method(value: DensityMethod): DensityBuilder
/**
* The number of uniformly spaced steps to take along the extent domain
* (default 100). A total of steps + 1 uniformly-spaced samples are drawn
* from the distribution.
*
* @param value
*/
steps(value: number): DensityBuilder
/**
* The output fields for the sample value and associated probability.
* The default is ["value", "density"].
*
* @param valueString
* @param probabilityField
*/
as(valueString: string, probabilityField: string): DensityBuilder
}
export enum DensityMethod {
/**
* Probability Density Funciton
*/
pdf = 'pdf',
/**
* Cumulative Distribution Function
*/
cdf = 'cdf',
}