@elaraai/east-py-datascience 0.0.2-beta.8 → 0.0.2-beta.80
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/README.md +58 -1
- package/dist/src/alns/alns.d.ts +528 -0
- package/dist/src/alns/alns.d.ts.map +1 -0
- package/dist/src/alns/alns.js +238 -0
- package/dist/src/alns/alns.js.map +1 -0
- package/dist/src/google_or/google_or.d.ts +2422 -0
- package/dist/src/google_or/google_or.d.ts.map +1 -0
- package/dist/src/google_or/google_or.js +542 -0
- package/dist/src/google_or/google_or.js.map +1 -0
- package/dist/{gp → src/gp}/gp.d.ts +185 -136
- package/dist/src/gp/gp.d.ts.map +1 -0
- package/dist/{gp → src/gp}/gp.js +64 -12
- package/dist/src/gp/gp.js.map +1 -0
- package/dist/src/index.d.ts +34 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +57 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lightgbm/lightgbm.d.ts +575 -0
- package/dist/src/lightgbm/lightgbm.d.ts.map +1 -0
- package/dist/{lightgbm → src/lightgbm}/lightgbm.js +104 -18
- package/dist/src/lightgbm/lightgbm.js.map +1 -0
- package/dist/src/lightning/lightning.d.ts +1594 -0
- package/dist/src/lightning/lightning.d.ts.map +1 -0
- package/dist/src/lightning/lightning.js +468 -0
- package/dist/src/lightning/lightning.js.map +1 -0
- package/dist/{mads → src/mads}/mads.d.ts +109 -112
- package/dist/src/mads/mads.d.ts.map +1 -0
- package/dist/{mads → src/mads}/mads.js +6 -8
- package/dist/src/mads/mads.js.map +1 -0
- package/dist/src/mapie/mapie.d.ts +3680 -0
- package/dist/src/mapie/mapie.d.ts.map +1 -0
- package/dist/src/mapie/mapie.js +616 -0
- package/dist/src/mapie/mapie.js.map +1 -0
- package/dist/{ngboost → src/ngboost}/ngboost.d.ts +192 -142
- package/dist/src/ngboost/ngboost.d.ts.map +1 -0
- package/dist/{ngboost → src/ngboost}/ngboost.js +67 -14
- package/dist/src/ngboost/ngboost.js.map +1 -0
- package/dist/src/optimization/optimization.d.ts +420 -0
- package/dist/src/optimization/optimization.d.ts.map +1 -0
- package/dist/src/optimization/optimization.js +257 -0
- package/dist/src/optimization/optimization.js.map +1 -0
- package/dist/{optuna → src/optuna}/optuna.d.ts +374 -314
- package/dist/src/optuna/optuna.d.ts.map +1 -0
- package/dist/{optuna → src/optuna}/optuna.js +2 -0
- package/dist/src/optuna/optuna.js.map +1 -0
- package/dist/src/pymc/pymc.d.ts +2932 -0
- package/dist/src/pymc/pymc.d.ts.map +1 -0
- package/dist/src/pymc/pymc.js +688 -0
- package/dist/src/pymc/pymc.js.map +1 -0
- package/dist/src/scipy/scipy.d.ts +2205 -0
- package/dist/src/scipy/scipy.d.ts.map +1 -0
- package/dist/src/scipy/scipy.js +884 -0
- package/dist/src/scipy/scipy.js.map +1 -0
- package/dist/src/shap/shap.d.ts +2988 -0
- package/dist/src/shap/shap.d.ts.map +1 -0
- package/dist/src/shap/shap.js +500 -0
- package/dist/src/shap/shap.js.map +1 -0
- package/dist/{simanneal → src/simanneal}/simanneal.d.ts +257 -160
- package/dist/src/simanneal/simanneal.d.ts.map +1 -0
- package/dist/{simanneal → src/simanneal}/simanneal.js +105 -8
- package/dist/src/simanneal/simanneal.js.map +1 -0
- package/dist/src/simulation/simulation.d.ts +431 -0
- package/dist/src/simulation/simulation.d.ts.map +1 -0
- package/dist/src/simulation/simulation.js +306 -0
- package/dist/src/simulation/simulation.js.map +1 -0
- package/dist/src/sklearn/sklearn.d.ts +6362 -0
- package/dist/src/sklearn/sklearn.d.ts.map +1 -0
- package/dist/src/sklearn/sklearn.js +1508 -0
- package/dist/src/sklearn/sklearn.js.map +1 -0
- package/dist/src/torch/torch.d.ts +1205 -0
- package/dist/src/torch/torch.d.ts.map +1 -0
- package/dist/{torch → src/torch}/torch.js +109 -18
- package/dist/src/torch/torch.js.map +1 -0
- package/dist/src/types.d.ts +43 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +44 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/xgboost/xgboost.d.ts +1424 -0
- package/dist/src/xgboost/xgboost.d.ts.map +1 -0
- package/dist/src/xgboost/xgboost.js +432 -0
- package/dist/src/xgboost/xgboost.js.map +1 -0
- package/package.json +12 -12
- package/dist/gp/gp.d.ts.map +0 -1
- package/dist/gp/gp.js.map +0 -1
- package/dist/index.d.ts +0 -27
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -41
- package/dist/index.js.map +0 -1
- package/dist/lightgbm/lightgbm.d.ts +0 -494
- package/dist/lightgbm/lightgbm.d.ts.map +0 -1
- package/dist/lightgbm/lightgbm.js.map +0 -1
- package/dist/mads/mads.d.ts.map +0 -1
- package/dist/mads/mads.js.map +0 -1
- package/dist/ngboost/ngboost.d.ts.map +0 -1
- package/dist/ngboost/ngboost.js.map +0 -1
- package/dist/optuna/optuna.d.ts.map +0 -1
- package/dist/optuna/optuna.js.map +0 -1
- package/dist/scipy/scipy.d.ts +0 -1260
- package/dist/scipy/scipy.d.ts.map +0 -1
- package/dist/scipy/scipy.js +0 -413
- package/dist/scipy/scipy.js.map +0 -1
- package/dist/shap/shap.d.ts +0 -657
- package/dist/shap/shap.d.ts.map +0 -1
- package/dist/shap/shap.js +0 -241
- package/dist/shap/shap.js.map +0 -1
- package/dist/simanneal/simanneal.d.ts.map +0 -1
- package/dist/simanneal/simanneal.js.map +0 -1
- package/dist/sklearn/sklearn.d.ts +0 -2691
- package/dist/sklearn/sklearn.d.ts.map +0 -1
- package/dist/sklearn/sklearn.js +0 -524
- package/dist/sklearn/sklearn.js.map +0 -1
- package/dist/torch/torch.d.ts +0 -1081
- package/dist/torch/torch.d.ts.map +0 -1
- package/dist/torch/torch.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types.d.ts +0 -80
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -81
- package/dist/types.js.map +0 -1
- package/dist/xgboost/xgboost.d.ts +0 -504
- package/dist/xgboost/xgboost.d.ts.map +0 -1
- package/dist/xgboost/xgboost.js +0 -177
- package/dist/xgboost/xgboost.js.map +0 -1
|
@@ -11,73 +11,74 @@
|
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
*/
|
|
13
13
|
import { StructType, VariantType, OptionType, IntegerType, FloatType, BooleanType, BlobType, StringType, NullType } from "@elaraai/east";
|
|
14
|
+
import { VectorType, MatrixType } from "../types.js";
|
|
14
15
|
export { VectorType, MatrixType } from "../types.js";
|
|
15
16
|
/**
|
|
16
17
|
* Kernel type for Gaussian Process.
|
|
17
18
|
*/
|
|
18
19
|
export declare const GPKernelType: VariantType<{
|
|
19
20
|
/** Radial Basis Function (squared exponential) */
|
|
20
|
-
rbf: NullType;
|
|
21
|
+
readonly rbf: NullType;
|
|
21
22
|
/** Matern with nu=1/2 (exponential) */
|
|
22
|
-
matern_1_2: NullType;
|
|
23
|
+
readonly matern_1_2: NullType;
|
|
23
24
|
/** Matern with nu=3/2 */
|
|
24
|
-
matern_3_2: NullType;
|
|
25
|
+
readonly matern_3_2: NullType;
|
|
25
26
|
/** Matern with nu=5/2 */
|
|
26
|
-
matern_5_2: NullType;
|
|
27
|
+
readonly matern_5_2: NullType;
|
|
27
28
|
/** Rational Quadratic */
|
|
28
|
-
rational_quadratic: NullType;
|
|
29
|
+
readonly rational_quadratic: NullType;
|
|
29
30
|
/** Dot Product (linear) */
|
|
30
|
-
dot_product: NullType;
|
|
31
|
+
readonly dot_product: NullType;
|
|
31
32
|
}>;
|
|
32
33
|
/**
|
|
33
34
|
* Configuration for Gaussian Process Regressor.
|
|
34
35
|
*/
|
|
35
36
|
export declare const GPConfigType: StructType<{
|
|
36
37
|
/** Kernel type (default rbf) */
|
|
37
|
-
kernel: OptionType<VariantType<{
|
|
38
|
+
readonly kernel: OptionType<VariantType<{
|
|
38
39
|
/** Radial Basis Function (squared exponential) */
|
|
39
|
-
rbf: NullType;
|
|
40
|
+
readonly rbf: NullType;
|
|
40
41
|
/** Matern with nu=1/2 (exponential) */
|
|
41
|
-
matern_1_2: NullType;
|
|
42
|
+
readonly matern_1_2: NullType;
|
|
42
43
|
/** Matern with nu=3/2 */
|
|
43
|
-
matern_3_2: NullType;
|
|
44
|
+
readonly matern_3_2: NullType;
|
|
44
45
|
/** Matern with nu=5/2 */
|
|
45
|
-
matern_5_2: NullType;
|
|
46
|
+
readonly matern_5_2: NullType;
|
|
46
47
|
/** Rational Quadratic */
|
|
47
|
-
rational_quadratic: NullType;
|
|
48
|
+
readonly rational_quadratic: NullType;
|
|
48
49
|
/** Dot Product (linear) */
|
|
49
|
-
dot_product: NullType;
|
|
50
|
+
readonly dot_product: NullType;
|
|
50
51
|
}>>;
|
|
51
52
|
/** Noise level added to diagonal (default 1e-10) */
|
|
52
|
-
alpha: OptionType<FloatType>;
|
|
53
|
+
readonly alpha: OptionType<FloatType>;
|
|
53
54
|
/** Number of restarts for optimizer (default 0) */
|
|
54
|
-
n_restarts_optimizer: OptionType<IntegerType>;
|
|
55
|
+
readonly n_restarts_optimizer: OptionType<IntegerType>;
|
|
55
56
|
/** Whether to normalize target values (default false) */
|
|
56
|
-
normalize_y: OptionType<BooleanType>;
|
|
57
|
+
readonly normalize_y: OptionType<BooleanType>;
|
|
57
58
|
/** Random seed for reproducibility */
|
|
58
|
-
random_state: OptionType<IntegerType>;
|
|
59
|
+
readonly random_state: OptionType<IntegerType>;
|
|
59
60
|
}>;
|
|
60
61
|
/**
|
|
61
62
|
* Result type for GP prediction with uncertainty.
|
|
62
63
|
*/
|
|
63
64
|
export declare const GPPredictResultType: StructType<{
|
|
64
65
|
/** Predicted mean values */
|
|
65
|
-
mean:
|
|
66
|
+
readonly mean: VectorType<FloatType>;
|
|
66
67
|
/** Predicted standard deviation (uncertainty) */
|
|
67
|
-
std:
|
|
68
|
+
readonly std: VectorType<FloatType>;
|
|
68
69
|
}>;
|
|
69
70
|
/**
|
|
70
71
|
* Model blob type for serialized GP models.
|
|
71
72
|
*/
|
|
72
73
|
export declare const GPModelBlobType: VariantType<{
|
|
73
74
|
/** Gaussian Process Regressor */
|
|
74
|
-
gp_regressor: StructType<{
|
|
75
|
+
readonly gp_regressor: StructType<{
|
|
75
76
|
/** Cloudpickle serialized model */
|
|
76
|
-
data: BlobType;
|
|
77
|
+
readonly data: BlobType;
|
|
77
78
|
/** Number of input features */
|
|
78
|
-
n_features: IntegerType;
|
|
79
|
+
readonly n_features: IntegerType;
|
|
79
80
|
/** Kernel type name for reference */
|
|
80
|
-
kernel_type: StringType;
|
|
81
|
+
readonly kernel_type: StringType;
|
|
81
82
|
}>;
|
|
82
83
|
}>;
|
|
83
84
|
/**
|
|
@@ -88,39 +89,39 @@ export declare const GPModelBlobType: VariantType<{
|
|
|
88
89
|
* @param config - GP configuration
|
|
89
90
|
* @returns Trained GP model blob
|
|
90
91
|
*/
|
|
91
|
-
export declare const gp_train: import("@elaraai/east").PlatformDefinition<[
|
|
92
|
+
export declare const gp_train: import("@elaraai/east").PlatformDefinition<[MatrixType<FloatType>, VectorType<FloatType>, StructType<{
|
|
92
93
|
/** Kernel type (default rbf) */
|
|
93
|
-
kernel: OptionType<VariantType<{
|
|
94
|
+
readonly kernel: OptionType<VariantType<{
|
|
94
95
|
/** Radial Basis Function (squared exponential) */
|
|
95
|
-
rbf: NullType;
|
|
96
|
+
readonly rbf: NullType;
|
|
96
97
|
/** Matern with nu=1/2 (exponential) */
|
|
97
|
-
matern_1_2: NullType;
|
|
98
|
+
readonly matern_1_2: NullType;
|
|
98
99
|
/** Matern with nu=3/2 */
|
|
99
|
-
matern_3_2: NullType;
|
|
100
|
+
readonly matern_3_2: NullType;
|
|
100
101
|
/** Matern with nu=5/2 */
|
|
101
|
-
matern_5_2: NullType;
|
|
102
|
+
readonly matern_5_2: NullType;
|
|
102
103
|
/** Rational Quadratic */
|
|
103
|
-
rational_quadratic: NullType;
|
|
104
|
+
readonly rational_quadratic: NullType;
|
|
104
105
|
/** Dot Product (linear) */
|
|
105
|
-
dot_product: NullType;
|
|
106
|
+
readonly dot_product: NullType;
|
|
106
107
|
}>>;
|
|
107
108
|
/** Noise level added to diagonal (default 1e-10) */
|
|
108
|
-
alpha: OptionType<FloatType>;
|
|
109
|
+
readonly alpha: OptionType<FloatType>;
|
|
109
110
|
/** Number of restarts for optimizer (default 0) */
|
|
110
|
-
n_restarts_optimizer: OptionType<IntegerType>;
|
|
111
|
+
readonly n_restarts_optimizer: OptionType<IntegerType>;
|
|
111
112
|
/** Whether to normalize target values (default false) */
|
|
112
|
-
normalize_y: OptionType<BooleanType>;
|
|
113
|
+
readonly normalize_y: OptionType<BooleanType>;
|
|
113
114
|
/** Random seed for reproducibility */
|
|
114
|
-
random_state: OptionType<IntegerType>;
|
|
115
|
+
readonly random_state: OptionType<IntegerType>;
|
|
115
116
|
}>], VariantType<{
|
|
116
117
|
/** Gaussian Process Regressor */
|
|
117
|
-
gp_regressor: StructType<{
|
|
118
|
+
readonly gp_regressor: StructType<{
|
|
118
119
|
/** Cloudpickle serialized model */
|
|
119
|
-
data: BlobType;
|
|
120
|
+
readonly data: BlobType;
|
|
120
121
|
/** Number of input features */
|
|
121
|
-
n_features: IntegerType;
|
|
122
|
+
readonly n_features: IntegerType;
|
|
122
123
|
/** Kernel type name for reference */
|
|
123
|
-
kernel_type: StringType;
|
|
124
|
+
readonly kernel_type: StringType;
|
|
124
125
|
}>;
|
|
125
126
|
}>>;
|
|
126
127
|
/**
|
|
@@ -134,15 +135,15 @@ export declare const gp_train: import("@elaraai/east").PlatformDefinition<[impor
|
|
|
134
135
|
*/
|
|
135
136
|
export declare const gp_predict: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
136
137
|
/** Gaussian Process Regressor */
|
|
137
|
-
gp_regressor: StructType<{
|
|
138
|
+
readonly gp_regressor: StructType<{
|
|
138
139
|
/** Cloudpickle serialized model */
|
|
139
|
-
data: BlobType;
|
|
140
|
+
readonly data: BlobType;
|
|
140
141
|
/** Number of input features */
|
|
141
|
-
n_features: IntegerType;
|
|
142
|
+
readonly n_features: IntegerType;
|
|
142
143
|
/** Kernel type name for reference */
|
|
143
|
-
kernel_type: StringType;
|
|
144
|
+
readonly kernel_type: StringType;
|
|
144
145
|
}>;
|
|
145
|
-
}>,
|
|
146
|
+
}>, MatrixType<FloatType>], VectorType<FloatType>>;
|
|
146
147
|
/**
|
|
147
148
|
* Make predictions with uncertainty estimates.
|
|
148
149
|
*
|
|
@@ -154,86 +155,82 @@ export declare const gp_predict: import("@elaraai/east").PlatformDefinition<[Var
|
|
|
154
155
|
*/
|
|
155
156
|
export declare const gp_predict_std: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
156
157
|
/** Gaussian Process Regressor */
|
|
157
|
-
gp_regressor: StructType<{
|
|
158
|
+
readonly gp_regressor: StructType<{
|
|
158
159
|
/** Cloudpickle serialized model */
|
|
159
|
-
data: BlobType;
|
|
160
|
+
readonly data: BlobType;
|
|
160
161
|
/** Number of input features */
|
|
161
|
-
n_features: IntegerType;
|
|
162
|
+
readonly n_features: IntegerType;
|
|
162
163
|
/** Kernel type name for reference */
|
|
163
|
-
kernel_type: StringType;
|
|
164
|
+
readonly kernel_type: StringType;
|
|
164
165
|
}>;
|
|
165
|
-
}>,
|
|
166
|
+
}>, MatrixType<FloatType>], StructType<{
|
|
166
167
|
/** Predicted mean values */
|
|
167
|
-
mean:
|
|
168
|
+
readonly mean: VectorType<FloatType>;
|
|
168
169
|
/** Predicted standard deviation (uncertainty) */
|
|
169
|
-
std:
|
|
170
|
+
readonly std: VectorType<FloatType>;
|
|
170
171
|
}>>;
|
|
171
172
|
/**
|
|
172
173
|
* Type definitions for GP functions.
|
|
173
174
|
*/
|
|
174
175
|
export declare const GPTypes: {
|
|
175
|
-
/** Vector type (array of floats) */
|
|
176
|
-
readonly VectorType: import("@elaraai/east").ArrayType<FloatType>;
|
|
177
|
-
/** Matrix type (2D array of floats) */
|
|
178
|
-
readonly MatrixType: import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>;
|
|
179
176
|
/** Kernel type */
|
|
180
177
|
readonly GPKernelType: VariantType<{
|
|
181
178
|
/** Radial Basis Function (squared exponential) */
|
|
182
|
-
rbf: NullType;
|
|
179
|
+
readonly rbf: NullType;
|
|
183
180
|
/** Matern with nu=1/2 (exponential) */
|
|
184
|
-
matern_1_2: NullType;
|
|
181
|
+
readonly matern_1_2: NullType;
|
|
185
182
|
/** Matern with nu=3/2 */
|
|
186
|
-
matern_3_2: NullType;
|
|
183
|
+
readonly matern_3_2: NullType;
|
|
187
184
|
/** Matern with nu=5/2 */
|
|
188
|
-
matern_5_2: NullType;
|
|
185
|
+
readonly matern_5_2: NullType;
|
|
189
186
|
/** Rational Quadratic */
|
|
190
|
-
rational_quadratic: NullType;
|
|
187
|
+
readonly rational_quadratic: NullType;
|
|
191
188
|
/** Dot Product (linear) */
|
|
192
|
-
dot_product: NullType;
|
|
189
|
+
readonly dot_product: NullType;
|
|
193
190
|
}>;
|
|
194
191
|
/** Configuration type */
|
|
195
192
|
readonly GPConfigType: StructType<{
|
|
196
193
|
/** Kernel type (default rbf) */
|
|
197
|
-
kernel: OptionType<VariantType<{
|
|
194
|
+
readonly kernel: OptionType<VariantType<{
|
|
198
195
|
/** Radial Basis Function (squared exponential) */
|
|
199
|
-
rbf: NullType;
|
|
196
|
+
readonly rbf: NullType;
|
|
200
197
|
/** Matern with nu=1/2 (exponential) */
|
|
201
|
-
matern_1_2: NullType;
|
|
198
|
+
readonly matern_1_2: NullType;
|
|
202
199
|
/** Matern with nu=3/2 */
|
|
203
|
-
matern_3_2: NullType;
|
|
200
|
+
readonly matern_3_2: NullType;
|
|
204
201
|
/** Matern with nu=5/2 */
|
|
205
|
-
matern_5_2: NullType;
|
|
202
|
+
readonly matern_5_2: NullType;
|
|
206
203
|
/** Rational Quadratic */
|
|
207
|
-
rational_quadratic: NullType;
|
|
204
|
+
readonly rational_quadratic: NullType;
|
|
208
205
|
/** Dot Product (linear) */
|
|
209
|
-
dot_product: NullType;
|
|
206
|
+
readonly dot_product: NullType;
|
|
210
207
|
}>>;
|
|
211
208
|
/** Noise level added to diagonal (default 1e-10) */
|
|
212
|
-
alpha: OptionType<FloatType>;
|
|
209
|
+
readonly alpha: OptionType<FloatType>;
|
|
213
210
|
/** Number of restarts for optimizer (default 0) */
|
|
214
|
-
n_restarts_optimizer: OptionType<IntegerType>;
|
|
211
|
+
readonly n_restarts_optimizer: OptionType<IntegerType>;
|
|
215
212
|
/** Whether to normalize target values (default false) */
|
|
216
|
-
normalize_y: OptionType<BooleanType>;
|
|
213
|
+
readonly normalize_y: OptionType<BooleanType>;
|
|
217
214
|
/** Random seed for reproducibility */
|
|
218
|
-
random_state: OptionType<IntegerType>;
|
|
215
|
+
readonly random_state: OptionType<IntegerType>;
|
|
219
216
|
}>;
|
|
220
217
|
/** Prediction result type with uncertainty */
|
|
221
218
|
readonly GPPredictResultType: StructType<{
|
|
222
219
|
/** Predicted mean values */
|
|
223
|
-
mean:
|
|
220
|
+
readonly mean: VectorType<FloatType>;
|
|
224
221
|
/** Predicted standard deviation (uncertainty) */
|
|
225
|
-
std:
|
|
222
|
+
readonly std: VectorType<FloatType>;
|
|
226
223
|
}>;
|
|
227
224
|
/** Model blob type for GP models */
|
|
228
225
|
readonly ModelBlobType: VariantType<{
|
|
229
226
|
/** Gaussian Process Regressor */
|
|
230
|
-
gp_regressor: StructType<{
|
|
227
|
+
readonly gp_regressor: StructType<{
|
|
231
228
|
/** Cloudpickle serialized model */
|
|
232
|
-
data: BlobType;
|
|
229
|
+
readonly data: BlobType;
|
|
233
230
|
/** Number of input features */
|
|
234
|
-
n_features: IntegerType;
|
|
231
|
+
readonly n_features: IntegerType;
|
|
235
232
|
/** Kernel type name for reference */
|
|
236
|
-
kernel_type: StringType;
|
|
233
|
+
readonly kernel_type: StringType;
|
|
237
234
|
}>;
|
|
238
235
|
}>;
|
|
239
236
|
};
|
|
@@ -262,135 +259,187 @@ export declare const GPTypes: {
|
|
|
262
259
|
* ```
|
|
263
260
|
*/
|
|
264
261
|
export declare const GP: {
|
|
265
|
-
/**
|
|
266
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Train a Gaussian Process regression model.
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```ts
|
|
267
|
+
* import { East, FloatType, MatrixType, VectorType, variant } from "@elaraai/east";
|
|
268
|
+
* import { GP, GPConfigType } from "@elaraai/east-py-datascience";
|
|
269
|
+
*
|
|
270
|
+
* const train = East.function([], GP.Types.ModelBlobType, ($) => {
|
|
271
|
+
* const X = $.let([[1.0], [2.0], [3.0], [4.0]]);
|
|
272
|
+
* const y = $.let(new Float64Array([1.0, 4.0, 9.0, 16.0]));
|
|
273
|
+
* const config = $.let({
|
|
274
|
+
* kernel: variant("some", variant("rbf", null)),
|
|
275
|
+
* alpha: variant("some", 1e-10),
|
|
276
|
+
* n_restarts_optimizer: variant("some", 5n),
|
|
277
|
+
* normalize_y: variant("some", true),
|
|
278
|
+
* random_state: variant("some", 42n),
|
|
279
|
+
* }, GPConfigType);
|
|
280
|
+
* return $.return(GP.train(X, y, config));
|
|
281
|
+
* });
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
readonly train: import("@elaraai/east").PlatformDefinition<[MatrixType<FloatType>, VectorType<FloatType>, StructType<{
|
|
267
285
|
/** Kernel type (default rbf) */
|
|
268
|
-
kernel: OptionType<VariantType<{
|
|
286
|
+
readonly kernel: OptionType<VariantType<{
|
|
269
287
|
/** Radial Basis Function (squared exponential) */
|
|
270
|
-
rbf: NullType;
|
|
288
|
+
readonly rbf: NullType;
|
|
271
289
|
/** Matern with nu=1/2 (exponential) */
|
|
272
|
-
matern_1_2: NullType;
|
|
290
|
+
readonly matern_1_2: NullType;
|
|
273
291
|
/** Matern with nu=3/2 */
|
|
274
|
-
matern_3_2: NullType;
|
|
292
|
+
readonly matern_3_2: NullType;
|
|
275
293
|
/** Matern with nu=5/2 */
|
|
276
|
-
matern_5_2: NullType;
|
|
294
|
+
readonly matern_5_2: NullType;
|
|
277
295
|
/** Rational Quadratic */
|
|
278
|
-
rational_quadratic: NullType;
|
|
296
|
+
readonly rational_quadratic: NullType;
|
|
279
297
|
/** Dot Product (linear) */
|
|
280
|
-
dot_product: NullType;
|
|
298
|
+
readonly dot_product: NullType;
|
|
281
299
|
}>>;
|
|
282
300
|
/** Noise level added to diagonal (default 1e-10) */
|
|
283
|
-
alpha: OptionType<FloatType>;
|
|
301
|
+
readonly alpha: OptionType<FloatType>;
|
|
284
302
|
/** Number of restarts for optimizer (default 0) */
|
|
285
|
-
n_restarts_optimizer: OptionType<IntegerType>;
|
|
303
|
+
readonly n_restarts_optimizer: OptionType<IntegerType>;
|
|
286
304
|
/** Whether to normalize target values (default false) */
|
|
287
|
-
normalize_y: OptionType<BooleanType>;
|
|
305
|
+
readonly normalize_y: OptionType<BooleanType>;
|
|
288
306
|
/** Random seed for reproducibility */
|
|
289
|
-
random_state: OptionType<IntegerType>;
|
|
307
|
+
readonly random_state: OptionType<IntegerType>;
|
|
290
308
|
}>], VariantType<{
|
|
291
309
|
/** Gaussian Process Regressor */
|
|
292
|
-
gp_regressor: StructType<{
|
|
310
|
+
readonly gp_regressor: StructType<{
|
|
293
311
|
/** Cloudpickle serialized model */
|
|
294
|
-
data: BlobType;
|
|
312
|
+
readonly data: BlobType;
|
|
295
313
|
/** Number of input features */
|
|
296
|
-
n_features: IntegerType;
|
|
314
|
+
readonly n_features: IntegerType;
|
|
297
315
|
/** Kernel type name for reference */
|
|
298
|
-
kernel_type: StringType;
|
|
316
|
+
readonly kernel_type: StringType;
|
|
299
317
|
}>;
|
|
300
318
|
}>>;
|
|
301
|
-
/**
|
|
319
|
+
/**
|
|
320
|
+
* Make predictions (mean only) with a trained GP model.
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```ts
|
|
324
|
+
* import { East, FloatType, MatrixType, VectorType } from "@elaraai/east";
|
|
325
|
+
* import { GP } from "@elaraai/east-py-datascience";
|
|
326
|
+
*
|
|
327
|
+
* const predictFn = East.function(
|
|
328
|
+
* [GP.Types.ModelBlobType, MatrixType(FloatType)],
|
|
329
|
+
* VectorType(FloatType),
|
|
330
|
+
* ($, model, X) => {
|
|
331
|
+
* return $.return(GP.predict(model, X));
|
|
332
|
+
* }
|
|
333
|
+
* );
|
|
334
|
+
* ```
|
|
335
|
+
*/
|
|
302
336
|
readonly predict: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
303
337
|
/** Gaussian Process Regressor */
|
|
304
|
-
gp_regressor: StructType<{
|
|
338
|
+
readonly gp_regressor: StructType<{
|
|
305
339
|
/** Cloudpickle serialized model */
|
|
306
|
-
data: BlobType;
|
|
340
|
+
readonly data: BlobType;
|
|
307
341
|
/** Number of input features */
|
|
308
|
-
n_features: IntegerType;
|
|
342
|
+
readonly n_features: IntegerType;
|
|
309
343
|
/** Kernel type name for reference */
|
|
310
|
-
kernel_type: StringType;
|
|
344
|
+
readonly kernel_type: StringType;
|
|
311
345
|
}>;
|
|
312
|
-
}>,
|
|
313
|
-
/**
|
|
346
|
+
}>, MatrixType<FloatType>], VectorType<FloatType>>;
|
|
347
|
+
/**
|
|
348
|
+
* Make predictions with uncertainty estimates (mean + std).
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
* ```ts
|
|
352
|
+
* import { East, FloatType, MatrixType } from "@elaraai/east";
|
|
353
|
+
* import { GP } from "@elaraai/east-py-datascience";
|
|
354
|
+
*
|
|
355
|
+
* const predictFn = East.function(
|
|
356
|
+
* [GP.Types.ModelBlobType, MatrixType(FloatType)],
|
|
357
|
+
* GP.Types.GPPredictResultType,
|
|
358
|
+
* ($, model, X) => {
|
|
359
|
+
* const result = $.let(GP.predictStd(model, X));
|
|
360
|
+
* // result.mean => predicted values
|
|
361
|
+
* // result.std => uncertainty (standard deviation)
|
|
362
|
+
* return $.return(result);
|
|
363
|
+
* }
|
|
364
|
+
* );
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
314
367
|
readonly predictStd: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
315
368
|
/** Gaussian Process Regressor */
|
|
316
|
-
gp_regressor: StructType<{
|
|
369
|
+
readonly gp_regressor: StructType<{
|
|
317
370
|
/** Cloudpickle serialized model */
|
|
318
|
-
data: BlobType;
|
|
371
|
+
readonly data: BlobType;
|
|
319
372
|
/** Number of input features */
|
|
320
|
-
n_features: IntegerType;
|
|
373
|
+
readonly n_features: IntegerType;
|
|
321
374
|
/** Kernel type name for reference */
|
|
322
|
-
kernel_type: StringType;
|
|
375
|
+
readonly kernel_type: StringType;
|
|
323
376
|
}>;
|
|
324
|
-
}>,
|
|
377
|
+
}>, MatrixType<FloatType>], StructType<{
|
|
325
378
|
/** Predicted mean values */
|
|
326
|
-
mean:
|
|
379
|
+
readonly mean: VectorType<FloatType>;
|
|
327
380
|
/** Predicted standard deviation (uncertainty) */
|
|
328
|
-
std:
|
|
381
|
+
readonly std: VectorType<FloatType>;
|
|
329
382
|
}>>;
|
|
330
383
|
/** Type definitions */
|
|
331
384
|
readonly Types: {
|
|
332
|
-
/** Vector type (array of floats) */
|
|
333
|
-
readonly VectorType: import("@elaraai/east").ArrayType<FloatType>;
|
|
334
|
-
/** Matrix type (2D array of floats) */
|
|
335
|
-
readonly MatrixType: import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>;
|
|
336
385
|
/** Kernel type */
|
|
337
386
|
readonly GPKernelType: VariantType<{
|
|
338
387
|
/** Radial Basis Function (squared exponential) */
|
|
339
|
-
rbf: NullType;
|
|
388
|
+
readonly rbf: NullType;
|
|
340
389
|
/** Matern with nu=1/2 (exponential) */
|
|
341
|
-
matern_1_2: NullType;
|
|
390
|
+
readonly matern_1_2: NullType;
|
|
342
391
|
/** Matern with nu=3/2 */
|
|
343
|
-
matern_3_2: NullType;
|
|
392
|
+
readonly matern_3_2: NullType;
|
|
344
393
|
/** Matern with nu=5/2 */
|
|
345
|
-
matern_5_2: NullType;
|
|
394
|
+
readonly matern_5_2: NullType;
|
|
346
395
|
/** Rational Quadratic */
|
|
347
|
-
rational_quadratic: NullType;
|
|
396
|
+
readonly rational_quadratic: NullType;
|
|
348
397
|
/** Dot Product (linear) */
|
|
349
|
-
dot_product: NullType;
|
|
398
|
+
readonly dot_product: NullType;
|
|
350
399
|
}>;
|
|
351
400
|
/** Configuration type */
|
|
352
401
|
readonly GPConfigType: StructType<{
|
|
353
402
|
/** Kernel type (default rbf) */
|
|
354
|
-
kernel: OptionType<VariantType<{
|
|
403
|
+
readonly kernel: OptionType<VariantType<{
|
|
355
404
|
/** Radial Basis Function (squared exponential) */
|
|
356
|
-
rbf: NullType;
|
|
405
|
+
readonly rbf: NullType;
|
|
357
406
|
/** Matern with nu=1/2 (exponential) */
|
|
358
|
-
matern_1_2: NullType;
|
|
407
|
+
readonly matern_1_2: NullType;
|
|
359
408
|
/** Matern with nu=3/2 */
|
|
360
|
-
matern_3_2: NullType;
|
|
409
|
+
readonly matern_3_2: NullType;
|
|
361
410
|
/** Matern with nu=5/2 */
|
|
362
|
-
matern_5_2: NullType;
|
|
411
|
+
readonly matern_5_2: NullType;
|
|
363
412
|
/** Rational Quadratic */
|
|
364
|
-
rational_quadratic: NullType;
|
|
413
|
+
readonly rational_quadratic: NullType;
|
|
365
414
|
/** Dot Product (linear) */
|
|
366
|
-
dot_product: NullType;
|
|
415
|
+
readonly dot_product: NullType;
|
|
367
416
|
}>>;
|
|
368
417
|
/** Noise level added to diagonal (default 1e-10) */
|
|
369
|
-
alpha: OptionType<FloatType>;
|
|
418
|
+
readonly alpha: OptionType<FloatType>;
|
|
370
419
|
/** Number of restarts for optimizer (default 0) */
|
|
371
|
-
n_restarts_optimizer: OptionType<IntegerType>;
|
|
420
|
+
readonly n_restarts_optimizer: OptionType<IntegerType>;
|
|
372
421
|
/** Whether to normalize target values (default false) */
|
|
373
|
-
normalize_y: OptionType<BooleanType>;
|
|
422
|
+
readonly normalize_y: OptionType<BooleanType>;
|
|
374
423
|
/** Random seed for reproducibility */
|
|
375
|
-
random_state: OptionType<IntegerType>;
|
|
424
|
+
readonly random_state: OptionType<IntegerType>;
|
|
376
425
|
}>;
|
|
377
426
|
/** Prediction result type with uncertainty */
|
|
378
427
|
readonly GPPredictResultType: StructType<{
|
|
379
428
|
/** Predicted mean values */
|
|
380
|
-
mean:
|
|
429
|
+
readonly mean: VectorType<FloatType>;
|
|
381
430
|
/** Predicted standard deviation (uncertainty) */
|
|
382
|
-
std:
|
|
431
|
+
readonly std: VectorType<FloatType>;
|
|
383
432
|
}>;
|
|
384
433
|
/** Model blob type for GP models */
|
|
385
434
|
readonly ModelBlobType: VariantType<{
|
|
386
435
|
/** Gaussian Process Regressor */
|
|
387
|
-
gp_regressor: StructType<{
|
|
436
|
+
readonly gp_regressor: StructType<{
|
|
388
437
|
/** Cloudpickle serialized model */
|
|
389
|
-
data: BlobType;
|
|
438
|
+
readonly data: BlobType;
|
|
390
439
|
/** Number of input features */
|
|
391
|
-
n_features: IntegerType;
|
|
440
|
+
readonly n_features: IntegerType;
|
|
392
441
|
/** Kernel type name for reference */
|
|
393
|
-
kernel_type: StringType;
|
|
442
|
+
readonly kernel_type: StringType;
|
|
394
443
|
}>;
|
|
395
444
|
}>;
|
|
396
445
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gp.d.ts","sourceRoot":"","sources":["../../../src/gp/gp.ts"],"names":[],"mappings":"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"}
|
package/dist/{gp → src/gp}/gp.js
RENAMED
|
@@ -60,9 +60,9 @@ export const GPConfigType = StructType({
|
|
|
60
60
|
*/
|
|
61
61
|
export const GPPredictResultType = StructType({
|
|
62
62
|
/** Predicted mean values */
|
|
63
|
-
mean: VectorType,
|
|
63
|
+
mean: VectorType(FloatType),
|
|
64
64
|
/** Predicted standard deviation (uncertainty) */
|
|
65
|
-
std: VectorType,
|
|
65
|
+
std: VectorType(FloatType),
|
|
66
66
|
});
|
|
67
67
|
// ============================================================================
|
|
68
68
|
// Model Blob Types
|
|
@@ -92,7 +92,7 @@ export const GPModelBlobType = VariantType({
|
|
|
92
92
|
* @param config - GP configuration
|
|
93
93
|
* @returns Trained GP model blob
|
|
94
94
|
*/
|
|
95
|
-
export const gp_train = East.platform("gp_train", [MatrixType, VectorType, GPConfigType], GPModelBlobType);
|
|
95
|
+
export const gp_train = East.platform("gp_train", [MatrixType(FloatType), VectorType(FloatType), GPConfigType], GPModelBlobType);
|
|
96
96
|
/**
|
|
97
97
|
* Make predictions with a trained Gaussian Process.
|
|
98
98
|
*
|
|
@@ -102,7 +102,7 @@ export const gp_train = East.platform("gp_train", [MatrixType, VectorType, GPCon
|
|
|
102
102
|
* @param X - Feature matrix
|
|
103
103
|
* @returns Predicted values
|
|
104
104
|
*/
|
|
105
|
-
export const gp_predict = East.platform("gp_predict", [GPModelBlobType, MatrixType], VectorType);
|
|
105
|
+
export const gp_predict = East.platform("gp_predict", [GPModelBlobType, MatrixType(FloatType)], VectorType(FloatType));
|
|
106
106
|
/**
|
|
107
107
|
* Make predictions with uncertainty estimates.
|
|
108
108
|
*
|
|
@@ -112,7 +112,7 @@ export const gp_predict = East.platform("gp_predict", [GPModelBlobType, MatrixTy
|
|
|
112
112
|
* @param X - Feature matrix
|
|
113
113
|
* @returns Prediction result with mean and std
|
|
114
114
|
*/
|
|
115
|
-
export const gp_predict_std = East.platform("gp_predict_std", [GPModelBlobType, MatrixType], GPPredictResultType);
|
|
115
|
+
export const gp_predict_std = East.platform("gp_predict_std", [GPModelBlobType, MatrixType(FloatType)], GPPredictResultType);
|
|
116
116
|
// ============================================================================
|
|
117
117
|
// Grouped Export
|
|
118
118
|
// ============================================================================
|
|
@@ -120,10 +120,6 @@ export const gp_predict_std = East.platform("gp_predict_std", [GPModelBlobType,
|
|
|
120
120
|
* Type definitions for GP functions.
|
|
121
121
|
*/
|
|
122
122
|
export const GPTypes = {
|
|
123
|
-
/** Vector type (array of floats) */
|
|
124
|
-
VectorType,
|
|
125
|
-
/** Matrix type (2D array of floats) */
|
|
126
|
-
MatrixType,
|
|
127
123
|
/** Kernel type */
|
|
128
124
|
GPKernelType,
|
|
129
125
|
/** Configuration type */
|
|
@@ -158,11 +154,67 @@ export const GPTypes = {
|
|
|
158
154
|
* ```
|
|
159
155
|
*/
|
|
160
156
|
export const GP = {
|
|
161
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* Train a Gaussian Process regression model.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* import { East, FloatType, MatrixType, VectorType, variant } from "@elaraai/east";
|
|
163
|
+
* import { GP, GPConfigType } from "@elaraai/east-py-datascience";
|
|
164
|
+
*
|
|
165
|
+
* const train = East.function([], GP.Types.ModelBlobType, ($) => {
|
|
166
|
+
* const X = $.let([[1.0], [2.0], [3.0], [4.0]]);
|
|
167
|
+
* const y = $.let(new Float64Array([1.0, 4.0, 9.0, 16.0]));
|
|
168
|
+
* const config = $.let({
|
|
169
|
+
* kernel: variant("some", variant("rbf", null)),
|
|
170
|
+
* alpha: variant("some", 1e-10),
|
|
171
|
+
* n_restarts_optimizer: variant("some", 5n),
|
|
172
|
+
* normalize_y: variant("some", true),
|
|
173
|
+
* random_state: variant("some", 42n),
|
|
174
|
+
* }, GPConfigType);
|
|
175
|
+
* return $.return(GP.train(X, y, config));
|
|
176
|
+
* });
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
162
179
|
train: gp_train,
|
|
163
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* Make predictions (mean only) with a trained GP model.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* import { East, FloatType, MatrixType, VectorType } from "@elaraai/east";
|
|
186
|
+
* import { GP } from "@elaraai/east-py-datascience";
|
|
187
|
+
*
|
|
188
|
+
* const predictFn = East.function(
|
|
189
|
+
* [GP.Types.ModelBlobType, MatrixType(FloatType)],
|
|
190
|
+
* VectorType(FloatType),
|
|
191
|
+
* ($, model, X) => {
|
|
192
|
+
* return $.return(GP.predict(model, X));
|
|
193
|
+
* }
|
|
194
|
+
* );
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
164
197
|
predict: gp_predict,
|
|
165
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* Make predictions with uncertainty estimates (mean + std).
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* import { East, FloatType, MatrixType } from "@elaraai/east";
|
|
204
|
+
* import { GP } from "@elaraai/east-py-datascience";
|
|
205
|
+
*
|
|
206
|
+
* const predictFn = East.function(
|
|
207
|
+
* [GP.Types.ModelBlobType, MatrixType(FloatType)],
|
|
208
|
+
* GP.Types.GPPredictResultType,
|
|
209
|
+
* ($, model, X) => {
|
|
210
|
+
* const result = $.let(GP.predictStd(model, X));
|
|
211
|
+
* // result.mean => predicted values
|
|
212
|
+
* // result.std => uncertainty (standard deviation)
|
|
213
|
+
* return $.return(result);
|
|
214
|
+
* }
|
|
215
|
+
* );
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
166
218
|
predictStd: gp_predict_std,
|
|
167
219
|
/** Type definitions */
|
|
168
220
|
Types: GPTypes,
|