@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
|
@@ -0,0 +1,2205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* SciPy platform functions for East.
|
|
7
|
+
*
|
|
8
|
+
* Provides scientific computing utilities: statistics, optimization,
|
|
9
|
+
* interpolation, and curve fitting.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { StructType, VariantType, OptionType, IntegerType, BooleanType, FloatType, StringType, BlobType, NullType, FunctionType } from "@elaraai/east";
|
|
14
|
+
import { VectorType, MatrixType } from "../types.js";
|
|
15
|
+
export { VectorType, MatrixType, ScalarObjectiveType } from "../types.js";
|
|
16
|
+
/**
|
|
17
|
+
* Optimization method for scipy.optimize.minimize.
|
|
18
|
+
*/
|
|
19
|
+
export declare const OptimizeMethodType: VariantType<{
|
|
20
|
+
/** BFGS algorithm */
|
|
21
|
+
readonly bfgs: NullType;
|
|
22
|
+
/** L-BFGS-B algorithm (default) */
|
|
23
|
+
readonly l_bfgs_b: NullType;
|
|
24
|
+
/** Nelder-Mead simplex */
|
|
25
|
+
readonly nelder_mead: NullType;
|
|
26
|
+
/** Powell's method */
|
|
27
|
+
readonly powell: NullType;
|
|
28
|
+
/** Conjugate gradient */
|
|
29
|
+
readonly cg: NullType;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Interpolation method for scipy.interpolate.interp1d.
|
|
33
|
+
*/
|
|
34
|
+
export declare const InterpolationKindType: VariantType<{
|
|
35
|
+
/** Linear interpolation (default) */
|
|
36
|
+
readonly linear: NullType;
|
|
37
|
+
/** Cubic interpolation */
|
|
38
|
+
readonly cubic: NullType;
|
|
39
|
+
/** Quadratic interpolation */
|
|
40
|
+
readonly quadratic: NullType;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Histogram bin selection method for numpy.histogram.
|
|
44
|
+
*/
|
|
45
|
+
export declare const HistogramBinMethodType: VariantType<{
|
|
46
|
+
/** Maximum of Sturges and FD estimators */
|
|
47
|
+
readonly auto: NullType;
|
|
48
|
+
/** Freedman-Diaconis estimator */
|
|
49
|
+
readonly fd: NullType;
|
|
50
|
+
/** Sturges estimator */
|
|
51
|
+
readonly sturges: NullType;
|
|
52
|
+
/** Scott's normal reference rule */
|
|
53
|
+
readonly scott: NullType;
|
|
54
|
+
/** Rice estimator */
|
|
55
|
+
readonly rice: NullType;
|
|
56
|
+
/** Square root estimator */
|
|
57
|
+
readonly sqrt: NullType;
|
|
58
|
+
/** Doane's estimator */
|
|
59
|
+
readonly doane: NullType;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Bandwidth selection method for KDE.
|
|
63
|
+
*/
|
|
64
|
+
export declare const KdeBandwidthMethodType: VariantType<{
|
|
65
|
+
/** Scott's rule of thumb (default) */
|
|
66
|
+
readonly scott: NullType;
|
|
67
|
+
/** Silverman's rule of thumb */
|
|
68
|
+
readonly silverman: NullType;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Configuration for scipy.optimize.minimize.
|
|
72
|
+
*/
|
|
73
|
+
export declare const OptimizeConfigType: StructType<{
|
|
74
|
+
/** Optimization method */
|
|
75
|
+
readonly method: OptionType<VariantType<{
|
|
76
|
+
/** BFGS algorithm */
|
|
77
|
+
readonly bfgs: NullType;
|
|
78
|
+
/** L-BFGS-B algorithm (default) */
|
|
79
|
+
readonly l_bfgs_b: NullType;
|
|
80
|
+
/** Nelder-Mead simplex */
|
|
81
|
+
readonly nelder_mead: NullType;
|
|
82
|
+
/** Powell's method */
|
|
83
|
+
readonly powell: NullType;
|
|
84
|
+
/** Conjugate gradient */
|
|
85
|
+
readonly cg: NullType;
|
|
86
|
+
}>>;
|
|
87
|
+
/** Maximum number of iterations */
|
|
88
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
89
|
+
/** Tolerance for convergence */
|
|
90
|
+
readonly tol: OptionType<FloatType>;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* Configuration for scipy.interpolate.interp1d.
|
|
94
|
+
*/
|
|
95
|
+
export declare const InterpolateConfigType: StructType<{
|
|
96
|
+
/** Interpolation method */
|
|
97
|
+
readonly kind: OptionType<VariantType<{
|
|
98
|
+
/** Linear interpolation (default) */
|
|
99
|
+
readonly linear: NullType;
|
|
100
|
+
/** Cubic interpolation */
|
|
101
|
+
readonly cubic: NullType;
|
|
102
|
+
/** Quadratic interpolation */
|
|
103
|
+
readonly quadratic: NullType;
|
|
104
|
+
}>>;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Parameter bounds for curve fitting.
|
|
108
|
+
*/
|
|
109
|
+
export declare const ParamBoundsType: StructType<{
|
|
110
|
+
/** Lower bounds for each parameter */
|
|
111
|
+
readonly lower: VectorType<FloatType>;
|
|
112
|
+
/** Upper bounds for each parameter */
|
|
113
|
+
readonly upper: VectorType<FloatType>;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* Custom curve function type: (x: Float, params: Vector, fixed_params: Vector) -> Float
|
|
117
|
+
* The params are optimized, fixed_params are passed through unchanged.
|
|
118
|
+
* If no fixed_params provided in config, an empty vector is passed.
|
|
119
|
+
*/
|
|
120
|
+
export declare const CustomCurveFunctionType: FunctionType<[FloatType, VectorType<FloatType>, VectorType<FloatType>], FloatType>;
|
|
121
|
+
/**
|
|
122
|
+
* Curve function type for scipy_curve_fit.
|
|
123
|
+
*
|
|
124
|
+
* Includes built-in standard mathematical functions and a custom option
|
|
125
|
+
* for user-defined functions.
|
|
126
|
+
*/
|
|
127
|
+
export declare const CurveFunctionType: VariantType<{
|
|
128
|
+
/** y = a * exp(-b * x), 2 params: [a, b] */
|
|
129
|
+
readonly exponential_decay: NullType;
|
|
130
|
+
/** y = a + b * exp(-c * x), 3 params: [a, b, c] */
|
|
131
|
+
readonly exponential_with_offset: NullType;
|
|
132
|
+
/** y = a * exp(b * x), 2 params: [a, b] */
|
|
133
|
+
readonly exponential_growth: NullType;
|
|
134
|
+
/** y = L / (1 + exp(-k * (x - x0))), 3 params: [L, k, x0] */
|
|
135
|
+
readonly logistic: NullType;
|
|
136
|
+
/** y = a * exp(-b * exp(-c * x)), 3 params: [a, b, c] */
|
|
137
|
+
readonly gompertz: NullType;
|
|
138
|
+
/** y = a * x^b, 2 params: [a, b] */
|
|
139
|
+
readonly power_law: NullType;
|
|
140
|
+
/** y = a + b * x, 2 params: [a, b] */
|
|
141
|
+
readonly linear: NullType;
|
|
142
|
+
/** y = a + b*x + c*x^2, 3 params: [a, b, c] */
|
|
143
|
+
readonly quadratic: NullType;
|
|
144
|
+
/** y = a + b*x + c*x^2 + d*x^3, 4 params: [a, b, c, d] */
|
|
145
|
+
readonly cubic: NullType;
|
|
146
|
+
/** Custom function provided by user */
|
|
147
|
+
readonly custom: StructType<{
|
|
148
|
+
/** The curve function: (x, params, fixed_params) -> y */
|
|
149
|
+
readonly fn: FunctionType<[FloatType, VectorType<FloatType>, VectorType<FloatType>], FloatType>;
|
|
150
|
+
/** Number of parameters to optimize */
|
|
151
|
+
readonly n_params: IntegerType;
|
|
152
|
+
/** Optional parameter bounds */
|
|
153
|
+
readonly param_bounds: OptionType<StructType<{
|
|
154
|
+
/** Lower bounds for each parameter */
|
|
155
|
+
readonly lower: VectorType<FloatType>;
|
|
156
|
+
/** Upper bounds for each parameter */
|
|
157
|
+
readonly upper: VectorType<FloatType>;
|
|
158
|
+
}>>;
|
|
159
|
+
/** Optional fixed parameters passed to fn but not optimized */
|
|
160
|
+
readonly fixed_params: OptionType<VectorType<FloatType>>;
|
|
161
|
+
}>;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* Configuration for curve fitting.
|
|
165
|
+
*/
|
|
166
|
+
export declare const CurveFitConfigType: StructType<{
|
|
167
|
+
/** Maximum number of function evaluations */
|
|
168
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
169
|
+
/** Initial guess for parameters */
|
|
170
|
+
readonly initial_guess: OptionType<VectorType<FloatType>>;
|
|
171
|
+
}>;
|
|
172
|
+
/**
|
|
173
|
+
* Configuration for histogram computation.
|
|
174
|
+
*/
|
|
175
|
+
export declare const HistogramConfigType: StructType<{
|
|
176
|
+
/** Number of bins (default 10) */
|
|
177
|
+
readonly bins: OptionType<IntegerType>;
|
|
178
|
+
/** Auto bin method (overrides bins if set) */
|
|
179
|
+
readonly bin_method: OptionType<VariantType<{
|
|
180
|
+
/** Maximum of Sturges and FD estimators */
|
|
181
|
+
readonly auto: NullType;
|
|
182
|
+
/** Freedman-Diaconis estimator */
|
|
183
|
+
readonly fd: NullType;
|
|
184
|
+
/** Sturges estimator */
|
|
185
|
+
readonly sturges: NullType;
|
|
186
|
+
/** Scott's normal reference rule */
|
|
187
|
+
readonly scott: NullType;
|
|
188
|
+
/** Rice estimator */
|
|
189
|
+
readonly rice: NullType;
|
|
190
|
+
/** Square root estimator */
|
|
191
|
+
readonly sqrt: NullType;
|
|
192
|
+
/** Doane's estimator */
|
|
193
|
+
readonly doane: NullType;
|
|
194
|
+
}>>;
|
|
195
|
+
/** Lower bound */
|
|
196
|
+
readonly range_min: OptionType<FloatType>;
|
|
197
|
+
/** Upper bound */
|
|
198
|
+
readonly range_max: OptionType<FloatType>;
|
|
199
|
+
/** Normalize to probability density */
|
|
200
|
+
readonly density: OptionType<BooleanType>;
|
|
201
|
+
/** Per-element weights */
|
|
202
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
203
|
+
}>;
|
|
204
|
+
/**
|
|
205
|
+
* Configuration for Kernel Density Estimation.
|
|
206
|
+
*/
|
|
207
|
+
export declare const KdeConfigType: StructType<{
|
|
208
|
+
/** Bandwidth selection method (default scott) */
|
|
209
|
+
readonly bandwidth: OptionType<VariantType<{
|
|
210
|
+
/** Scott's rule of thumb (default) */
|
|
211
|
+
readonly scott: NullType;
|
|
212
|
+
/** Silverman's rule of thumb */
|
|
213
|
+
readonly silverman: NullType;
|
|
214
|
+
}>>;
|
|
215
|
+
/** Custom scalar bandwidth (overrides method if set) */
|
|
216
|
+
readonly bandwidth_scalar: OptionType<FloatType>;
|
|
217
|
+
/** Per-datapoint weights */
|
|
218
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
219
|
+
}>;
|
|
220
|
+
/**
|
|
221
|
+
* Configuration for quadratic optimization: f(x) = 0.5 * x'Ax + b'x + c
|
|
222
|
+
*/
|
|
223
|
+
export declare const QuadraticConfigType: StructType<{
|
|
224
|
+
/** Quadratic term (symmetric positive definite) */
|
|
225
|
+
readonly A: MatrixType<FloatType>;
|
|
226
|
+
/** Linear term */
|
|
227
|
+
readonly b: VectorType<FloatType>;
|
|
228
|
+
/** Constant term */
|
|
229
|
+
readonly c: FloatType;
|
|
230
|
+
}>;
|
|
231
|
+
/**
|
|
232
|
+
* Descriptive statistics result.
|
|
233
|
+
*/
|
|
234
|
+
export declare const StatsDescribeResultType: StructType<{
|
|
235
|
+
/** Number of observations */
|
|
236
|
+
readonly count: IntegerType;
|
|
237
|
+
/** Mean value */
|
|
238
|
+
readonly mean: FloatType;
|
|
239
|
+
/** Variance */
|
|
240
|
+
readonly variance: FloatType;
|
|
241
|
+
/** Skewness */
|
|
242
|
+
readonly skewness: FloatType;
|
|
243
|
+
/** Kurtosis */
|
|
244
|
+
readonly kurtosis: FloatType;
|
|
245
|
+
/** Minimum value */
|
|
246
|
+
readonly min: FloatType;
|
|
247
|
+
/** Maximum value */
|
|
248
|
+
readonly max: FloatType;
|
|
249
|
+
}>;
|
|
250
|
+
/**
|
|
251
|
+
* Robust statistics result (median-based, outlier-resistant).
|
|
252
|
+
*/
|
|
253
|
+
export declare const RobustStatsResultType: StructType<{
|
|
254
|
+
/** Median value */
|
|
255
|
+
readonly median: FloatType;
|
|
256
|
+
/** Interquartile range (Q3 - Q1) */
|
|
257
|
+
readonly iqr: FloatType;
|
|
258
|
+
/** Median absolute deviation */
|
|
259
|
+
readonly mad: FloatType;
|
|
260
|
+
/** 25th percentile */
|
|
261
|
+
readonly q1: FloatType;
|
|
262
|
+
/** 75th percentile */
|
|
263
|
+
readonly q3: FloatType;
|
|
264
|
+
}>;
|
|
265
|
+
/**
|
|
266
|
+
* Correlation result (Pearson or Spearman).
|
|
267
|
+
*/
|
|
268
|
+
export declare const CorrelationResultType: StructType<{
|
|
269
|
+
/** Correlation coefficient */
|
|
270
|
+
readonly correlation: FloatType;
|
|
271
|
+
/** P-value for hypothesis test */
|
|
272
|
+
readonly pvalue: FloatType;
|
|
273
|
+
}>;
|
|
274
|
+
/**
|
|
275
|
+
* Curve fitting result.
|
|
276
|
+
*/
|
|
277
|
+
export declare const CurveFitResultType: StructType<{
|
|
278
|
+
/** Fitted parameters */
|
|
279
|
+
readonly params: VectorType<FloatType>;
|
|
280
|
+
/** Whether fit converged */
|
|
281
|
+
readonly success: BooleanType;
|
|
282
|
+
/** Coefficient of determination (R²) */
|
|
283
|
+
readonly r_squared: FloatType;
|
|
284
|
+
}>;
|
|
285
|
+
/**
|
|
286
|
+
* Optimization result.
|
|
287
|
+
*/
|
|
288
|
+
export declare const OptimizeResultType: StructType<{
|
|
289
|
+
/** Optimal parameters */
|
|
290
|
+
readonly x: VectorType<FloatType>;
|
|
291
|
+
/** Function value at optimum */
|
|
292
|
+
readonly fun: FloatType;
|
|
293
|
+
/** Whether optimization succeeded */
|
|
294
|
+
readonly success: BooleanType;
|
|
295
|
+
/** Number of iterations */
|
|
296
|
+
readonly nit: IntegerType;
|
|
297
|
+
}>;
|
|
298
|
+
/**
|
|
299
|
+
* Histogram computation result.
|
|
300
|
+
*/
|
|
301
|
+
export declare const HistogramResultType: StructType<{
|
|
302
|
+
/** Bin values (float to support density mode) */
|
|
303
|
+
readonly counts: VectorType<FloatType>;
|
|
304
|
+
/** Bin edges (length = len(counts) + 1) */
|
|
305
|
+
readonly bin_edges: VectorType<FloatType>;
|
|
306
|
+
}>;
|
|
307
|
+
/**
|
|
308
|
+
* KDE fitting result metadata.
|
|
309
|
+
*/
|
|
310
|
+
export declare const KdeResultType: StructType<{
|
|
311
|
+
/** Actual bandwidth factor used */
|
|
312
|
+
readonly bandwidth: FloatType;
|
|
313
|
+
/** Minimum of training data */
|
|
314
|
+
readonly data_min: FloatType;
|
|
315
|
+
/** Maximum of training data */
|
|
316
|
+
readonly data_max: FloatType;
|
|
317
|
+
}>;
|
|
318
|
+
/**
|
|
319
|
+
* Model blob type for scipy models.
|
|
320
|
+
*/
|
|
321
|
+
export declare const ScipyModelBlobType: VariantType<{
|
|
322
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
323
|
+
readonly scipy_interp_1d: StructType<{
|
|
324
|
+
/** Serialized interpolator */
|
|
325
|
+
readonly data: BlobType;
|
|
326
|
+
/** Interpolation method used */
|
|
327
|
+
readonly kind: VariantType<{
|
|
328
|
+
/** Linear interpolation (default) */
|
|
329
|
+
readonly linear: NullType;
|
|
330
|
+
/** Cubic interpolation */
|
|
331
|
+
readonly cubic: NullType;
|
|
332
|
+
/** Quadratic interpolation */
|
|
333
|
+
readonly quadratic: NullType;
|
|
334
|
+
}>;
|
|
335
|
+
}>;
|
|
336
|
+
/** KDE model (cloudpickle serialized) */
|
|
337
|
+
readonly scipy_kde: StructType<{
|
|
338
|
+
/** Serialized KDE model */
|
|
339
|
+
readonly data: BlobType;
|
|
340
|
+
/** KDE metadata */
|
|
341
|
+
readonly metadata: StructType<{
|
|
342
|
+
/** Actual bandwidth factor used */
|
|
343
|
+
readonly bandwidth: FloatType;
|
|
344
|
+
/** Minimum of training data */
|
|
345
|
+
readonly data_min: FloatType;
|
|
346
|
+
/** Maximum of training data */
|
|
347
|
+
readonly data_max: FloatType;
|
|
348
|
+
}>;
|
|
349
|
+
}>;
|
|
350
|
+
}>;
|
|
351
|
+
/**
|
|
352
|
+
* Bounds for dual annealing optimization (required).
|
|
353
|
+
*/
|
|
354
|
+
export declare const DualAnnealBoundsType: StructType<{
|
|
355
|
+
/** Lower bounds for each variable */
|
|
356
|
+
readonly lower: VectorType<FloatType>;
|
|
357
|
+
/** Upper bounds for each variable */
|
|
358
|
+
readonly upper: VectorType<FloatType>;
|
|
359
|
+
}>;
|
|
360
|
+
/**
|
|
361
|
+
* Configuration for scipy.optimize.dual_annealing.
|
|
362
|
+
*
|
|
363
|
+
* Combines generalized simulated annealing with local search.
|
|
364
|
+
* Much faster than pure Python simanneal for continuous optimization.
|
|
365
|
+
*/
|
|
366
|
+
export declare const DualAnnealConfigType: StructType<{
|
|
367
|
+
/** Maximum function evaluations (default: 1000) */
|
|
368
|
+
readonly maxfun: OptionType<IntegerType>;
|
|
369
|
+
/** Maximum iterations (default: 1000) */
|
|
370
|
+
readonly maxiter: OptionType<IntegerType>;
|
|
371
|
+
/** Initial temperature (default: 5230) */
|
|
372
|
+
readonly initial_temp: OptionType<FloatType>;
|
|
373
|
+
/** Temperature restart threshold (default: 2e-5) */
|
|
374
|
+
readonly restart_temp_ratio: OptionType<FloatType>;
|
|
375
|
+
/** Visiting distribution parameter (default: 2.62) */
|
|
376
|
+
readonly visit: OptionType<FloatType>;
|
|
377
|
+
/** Acceptance distribution parameter (default: -5.0) */
|
|
378
|
+
readonly accept: OptionType<FloatType>;
|
|
379
|
+
/** Random seed for reproducibility */
|
|
380
|
+
readonly seed: OptionType<IntegerType>;
|
|
381
|
+
/** Disable local search for speed (default: false) */
|
|
382
|
+
readonly no_local_search: OptionType<BooleanType>;
|
|
383
|
+
}>;
|
|
384
|
+
/**
|
|
385
|
+
* Result from dual annealing optimization.
|
|
386
|
+
*/
|
|
387
|
+
export declare const DualAnnealResultType: StructType<{
|
|
388
|
+
/** Best solution found */
|
|
389
|
+
readonly x: VectorType<FloatType>;
|
|
390
|
+
/** Best objective value */
|
|
391
|
+
readonly fun: FloatType;
|
|
392
|
+
/** Number of function evaluations */
|
|
393
|
+
readonly nfev: IntegerType;
|
|
394
|
+
/** Number of iterations */
|
|
395
|
+
readonly nit: IntegerType;
|
|
396
|
+
/** Whether optimization succeeded */
|
|
397
|
+
readonly success: BooleanType;
|
|
398
|
+
/** Status message */
|
|
399
|
+
readonly message: StringType;
|
|
400
|
+
}>;
|
|
401
|
+
/**
|
|
402
|
+
* Fit a parametric curve to data using nonlinear least squares.
|
|
403
|
+
*/
|
|
404
|
+
export declare const scipy_curve_fit: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
405
|
+
/** y = a * exp(-b * x), 2 params: [a, b] */
|
|
406
|
+
readonly exponential_decay: NullType;
|
|
407
|
+
/** y = a + b * exp(-c * x), 3 params: [a, b, c] */
|
|
408
|
+
readonly exponential_with_offset: NullType;
|
|
409
|
+
/** y = a * exp(b * x), 2 params: [a, b] */
|
|
410
|
+
readonly exponential_growth: NullType;
|
|
411
|
+
/** y = L / (1 + exp(-k * (x - x0))), 3 params: [L, k, x0] */
|
|
412
|
+
readonly logistic: NullType;
|
|
413
|
+
/** y = a * exp(-b * exp(-c * x)), 3 params: [a, b, c] */
|
|
414
|
+
readonly gompertz: NullType;
|
|
415
|
+
/** y = a * x^b, 2 params: [a, b] */
|
|
416
|
+
readonly power_law: NullType;
|
|
417
|
+
/** y = a + b * x, 2 params: [a, b] */
|
|
418
|
+
readonly linear: NullType;
|
|
419
|
+
/** y = a + b*x + c*x^2, 3 params: [a, b, c] */
|
|
420
|
+
readonly quadratic: NullType;
|
|
421
|
+
/** y = a + b*x + c*x^2 + d*x^3, 4 params: [a, b, c, d] */
|
|
422
|
+
readonly cubic: NullType;
|
|
423
|
+
/** Custom function provided by user */
|
|
424
|
+
readonly custom: StructType<{
|
|
425
|
+
/** The curve function: (x, params, fixed_params) -> y */
|
|
426
|
+
readonly fn: FunctionType<[FloatType, VectorType<FloatType>, VectorType<FloatType>], FloatType>;
|
|
427
|
+
/** Number of parameters to optimize */
|
|
428
|
+
readonly n_params: IntegerType;
|
|
429
|
+
/** Optional parameter bounds */
|
|
430
|
+
readonly param_bounds: OptionType<StructType<{
|
|
431
|
+
/** Lower bounds for each parameter */
|
|
432
|
+
readonly lower: VectorType<FloatType>;
|
|
433
|
+
/** Upper bounds for each parameter */
|
|
434
|
+
readonly upper: VectorType<FloatType>;
|
|
435
|
+
}>>;
|
|
436
|
+
/** Optional fixed parameters passed to fn but not optimized */
|
|
437
|
+
readonly fixed_params: OptionType<VectorType<FloatType>>;
|
|
438
|
+
}>;
|
|
439
|
+
}>, VectorType<FloatType>, VectorType<FloatType>, StructType<{
|
|
440
|
+
/** Maximum number of function evaluations */
|
|
441
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
442
|
+
/** Initial guess for parameters */
|
|
443
|
+
readonly initial_guess: OptionType<VectorType<FloatType>>;
|
|
444
|
+
}>], StructType<{
|
|
445
|
+
/** Fitted parameters */
|
|
446
|
+
readonly params: VectorType<FloatType>;
|
|
447
|
+
/** Whether fit converged */
|
|
448
|
+
readonly success: BooleanType;
|
|
449
|
+
/** Coefficient of determination (R²) */
|
|
450
|
+
readonly r_squared: FloatType;
|
|
451
|
+
}>>;
|
|
452
|
+
/**
|
|
453
|
+
* Compute descriptive statistics for data.
|
|
454
|
+
*/
|
|
455
|
+
export declare const scipy_stats_describe: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], StructType<{
|
|
456
|
+
/** Number of observations */
|
|
457
|
+
readonly count: IntegerType;
|
|
458
|
+
/** Mean value */
|
|
459
|
+
readonly mean: FloatType;
|
|
460
|
+
/** Variance */
|
|
461
|
+
readonly variance: FloatType;
|
|
462
|
+
/** Skewness */
|
|
463
|
+
readonly skewness: FloatType;
|
|
464
|
+
/** Kurtosis */
|
|
465
|
+
readonly kurtosis: FloatType;
|
|
466
|
+
/** Minimum value */
|
|
467
|
+
readonly min: FloatType;
|
|
468
|
+
/** Maximum value */
|
|
469
|
+
readonly max: FloatType;
|
|
470
|
+
}>>;
|
|
471
|
+
/**
|
|
472
|
+
* Compute Pearson correlation coefficient.
|
|
473
|
+
*/
|
|
474
|
+
export declare const scipy_stats_pearsonr: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, VectorType<FloatType>], StructType<{
|
|
475
|
+
/** Correlation coefficient */
|
|
476
|
+
readonly correlation: FloatType;
|
|
477
|
+
/** P-value for hypothesis test */
|
|
478
|
+
readonly pvalue: FloatType;
|
|
479
|
+
}>>;
|
|
480
|
+
/**
|
|
481
|
+
* Compute Spearman rank correlation.
|
|
482
|
+
*/
|
|
483
|
+
export declare const scipy_stats_spearmanr: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, VectorType<FloatType>], StructType<{
|
|
484
|
+
/** Correlation coefficient */
|
|
485
|
+
readonly correlation: FloatType;
|
|
486
|
+
/** P-value for hypothesis test */
|
|
487
|
+
readonly pvalue: FloatType;
|
|
488
|
+
}>>;
|
|
489
|
+
/**
|
|
490
|
+
* Compute percentiles of data.
|
|
491
|
+
* @param data - Input data vector
|
|
492
|
+
* @param percentiles - Percentile values to compute (0-100)
|
|
493
|
+
* @returns Values at the specified percentiles
|
|
494
|
+
*/
|
|
495
|
+
export declare const scipy_stats_percentile: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, VectorType<FloatType>], VectorType<FloatType>>;
|
|
496
|
+
/**
|
|
497
|
+
* Compute the percentile rank of a score relative to a dataset.
|
|
498
|
+
* @param data - Reference data vector
|
|
499
|
+
* @param score - Value to compute the percentile rank for
|
|
500
|
+
* @returns Percentile rank (0-100)
|
|
501
|
+
*/
|
|
502
|
+
export declare const scipy_stats_percentileofscore: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, FloatType], FloatType>;
|
|
503
|
+
/**
|
|
504
|
+
* Compute interquartile range (Q3 - Q1).
|
|
505
|
+
*/
|
|
506
|
+
export declare const scipy_stats_iqr: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], FloatType>;
|
|
507
|
+
/**
|
|
508
|
+
* Compute median value.
|
|
509
|
+
*/
|
|
510
|
+
export declare const scipy_stats_median: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], FloatType>;
|
|
511
|
+
/**
|
|
512
|
+
* Compute median absolute deviation (robust std estimate).
|
|
513
|
+
*/
|
|
514
|
+
export declare const scipy_stats_mad: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], FloatType>;
|
|
515
|
+
/**
|
|
516
|
+
* Compute robust statistics in one call (median, iqr, mad, q1, q3).
|
|
517
|
+
*/
|
|
518
|
+
export declare const scipy_stats_robust: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], StructType<{
|
|
519
|
+
/** Median value */
|
|
520
|
+
readonly median: FloatType;
|
|
521
|
+
/** Interquartile range (Q3 - Q1) */
|
|
522
|
+
readonly iqr: FloatType;
|
|
523
|
+
/** Median absolute deviation */
|
|
524
|
+
readonly mad: FloatType;
|
|
525
|
+
/** 25th percentile */
|
|
526
|
+
readonly q1: FloatType;
|
|
527
|
+
/** 75th percentile */
|
|
528
|
+
readonly q3: FloatType;
|
|
529
|
+
}>>;
|
|
530
|
+
/**
|
|
531
|
+
* Fit 1D interpolator to data.
|
|
532
|
+
*/
|
|
533
|
+
export declare const scipy_interpolate_1d_fit: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, VectorType<FloatType>, StructType<{
|
|
534
|
+
/** Interpolation method */
|
|
535
|
+
readonly kind: OptionType<VariantType<{
|
|
536
|
+
/** Linear interpolation (default) */
|
|
537
|
+
readonly linear: NullType;
|
|
538
|
+
/** Cubic interpolation */
|
|
539
|
+
readonly cubic: NullType;
|
|
540
|
+
/** Quadratic interpolation */
|
|
541
|
+
readonly quadratic: NullType;
|
|
542
|
+
}>>;
|
|
543
|
+
}>], VariantType<{
|
|
544
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
545
|
+
readonly scipy_interp_1d: StructType<{
|
|
546
|
+
/** Serialized interpolator */
|
|
547
|
+
readonly data: BlobType;
|
|
548
|
+
/** Interpolation method used */
|
|
549
|
+
readonly kind: VariantType<{
|
|
550
|
+
/** Linear interpolation (default) */
|
|
551
|
+
readonly linear: NullType;
|
|
552
|
+
/** Cubic interpolation */
|
|
553
|
+
readonly cubic: NullType;
|
|
554
|
+
/** Quadratic interpolation */
|
|
555
|
+
readonly quadratic: NullType;
|
|
556
|
+
}>;
|
|
557
|
+
}>;
|
|
558
|
+
/** KDE model (cloudpickle serialized) */
|
|
559
|
+
readonly scipy_kde: StructType<{
|
|
560
|
+
/** Serialized KDE model */
|
|
561
|
+
readonly data: BlobType;
|
|
562
|
+
/** KDE metadata */
|
|
563
|
+
readonly metadata: StructType<{
|
|
564
|
+
/** Actual bandwidth factor used */
|
|
565
|
+
readonly bandwidth: FloatType;
|
|
566
|
+
/** Minimum of training data */
|
|
567
|
+
readonly data_min: FloatType;
|
|
568
|
+
/** Maximum of training data */
|
|
569
|
+
readonly data_max: FloatType;
|
|
570
|
+
}>;
|
|
571
|
+
}>;
|
|
572
|
+
}>>;
|
|
573
|
+
/**
|
|
574
|
+
* Evaluate 1D interpolator at given points.
|
|
575
|
+
*/
|
|
576
|
+
export declare const scipy_interpolate_1d_predict: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
577
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
578
|
+
readonly scipy_interp_1d: StructType<{
|
|
579
|
+
/** Serialized interpolator */
|
|
580
|
+
readonly data: BlobType;
|
|
581
|
+
/** Interpolation method used */
|
|
582
|
+
readonly kind: VariantType<{
|
|
583
|
+
/** Linear interpolation (default) */
|
|
584
|
+
readonly linear: NullType;
|
|
585
|
+
/** Cubic interpolation */
|
|
586
|
+
readonly cubic: NullType;
|
|
587
|
+
/** Quadratic interpolation */
|
|
588
|
+
readonly quadratic: NullType;
|
|
589
|
+
}>;
|
|
590
|
+
}>;
|
|
591
|
+
/** KDE model (cloudpickle serialized) */
|
|
592
|
+
readonly scipy_kde: StructType<{
|
|
593
|
+
/** Serialized KDE model */
|
|
594
|
+
readonly data: BlobType;
|
|
595
|
+
/** KDE metadata */
|
|
596
|
+
readonly metadata: StructType<{
|
|
597
|
+
/** Actual bandwidth factor used */
|
|
598
|
+
readonly bandwidth: FloatType;
|
|
599
|
+
/** Minimum of training data */
|
|
600
|
+
readonly data_min: FloatType;
|
|
601
|
+
/** Maximum of training data */
|
|
602
|
+
readonly data_max: FloatType;
|
|
603
|
+
}>;
|
|
604
|
+
}>;
|
|
605
|
+
}>, VectorType<FloatType>], VectorType<FloatType>>;
|
|
606
|
+
/**
|
|
607
|
+
* Minimize a scalar function using scipy.optimize.minimize.
|
|
608
|
+
*/
|
|
609
|
+
export declare const scipy_optimize_minimize: import("@elaraai/east").PlatformDefinition<[FunctionType<[VectorType<FloatType>], FloatType>, VectorType<FloatType>, StructType<{
|
|
610
|
+
/** Optimization method */
|
|
611
|
+
readonly method: OptionType<VariantType<{
|
|
612
|
+
/** BFGS algorithm */
|
|
613
|
+
readonly bfgs: NullType;
|
|
614
|
+
/** L-BFGS-B algorithm (default) */
|
|
615
|
+
readonly l_bfgs_b: NullType;
|
|
616
|
+
/** Nelder-Mead simplex */
|
|
617
|
+
readonly nelder_mead: NullType;
|
|
618
|
+
/** Powell's method */
|
|
619
|
+
readonly powell: NullType;
|
|
620
|
+
/** Conjugate gradient */
|
|
621
|
+
readonly cg: NullType;
|
|
622
|
+
}>>;
|
|
623
|
+
/** Maximum number of iterations */
|
|
624
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
625
|
+
/** Tolerance for convergence */
|
|
626
|
+
readonly tol: OptionType<FloatType>;
|
|
627
|
+
}>], StructType<{
|
|
628
|
+
/** Optimal parameters */
|
|
629
|
+
readonly x: VectorType<FloatType>;
|
|
630
|
+
/** Function value at optimum */
|
|
631
|
+
readonly fun: FloatType;
|
|
632
|
+
/** Whether optimization succeeded */
|
|
633
|
+
readonly success: BooleanType;
|
|
634
|
+
/** Number of iterations */
|
|
635
|
+
readonly nit: IntegerType;
|
|
636
|
+
}>>;
|
|
637
|
+
/**
|
|
638
|
+
* Minimize a quadratic function with analytical gradient.
|
|
639
|
+
*/
|
|
640
|
+
export declare const scipy_optimize_minimize_quadratic: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, StructType<{
|
|
641
|
+
/** Quadratic term (symmetric positive definite) */
|
|
642
|
+
readonly A: MatrixType<FloatType>;
|
|
643
|
+
/** Linear term */
|
|
644
|
+
readonly b: VectorType<FloatType>;
|
|
645
|
+
/** Constant term */
|
|
646
|
+
readonly c: FloatType;
|
|
647
|
+
}>, StructType<{
|
|
648
|
+
/** Optimization method */
|
|
649
|
+
readonly method: OptionType<VariantType<{
|
|
650
|
+
/** BFGS algorithm */
|
|
651
|
+
readonly bfgs: NullType;
|
|
652
|
+
/** L-BFGS-B algorithm (default) */
|
|
653
|
+
readonly l_bfgs_b: NullType;
|
|
654
|
+
/** Nelder-Mead simplex */
|
|
655
|
+
readonly nelder_mead: NullType;
|
|
656
|
+
/** Powell's method */
|
|
657
|
+
readonly powell: NullType;
|
|
658
|
+
/** Conjugate gradient */
|
|
659
|
+
readonly cg: NullType;
|
|
660
|
+
}>>;
|
|
661
|
+
/** Maximum number of iterations */
|
|
662
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
663
|
+
/** Tolerance for convergence */
|
|
664
|
+
readonly tol: OptionType<FloatType>;
|
|
665
|
+
}>], StructType<{
|
|
666
|
+
/** Optimal parameters */
|
|
667
|
+
readonly x: VectorType<FloatType>;
|
|
668
|
+
/** Function value at optimum */
|
|
669
|
+
readonly fun: FloatType;
|
|
670
|
+
/** Whether optimization succeeded */
|
|
671
|
+
readonly success: BooleanType;
|
|
672
|
+
/** Number of iterations */
|
|
673
|
+
readonly nit: IntegerType;
|
|
674
|
+
}>>;
|
|
675
|
+
/**
|
|
676
|
+
* Global optimization using dual annealing.
|
|
677
|
+
*
|
|
678
|
+
* Combines generalized simulated annealing with local search.
|
|
679
|
+
* Much faster than simanneal for continuous optimization problems.
|
|
680
|
+
* Effective for non-convex problems with many local minima.
|
|
681
|
+
*
|
|
682
|
+
* @param objective_fn - Function to minimize: Vector -> Float
|
|
683
|
+
* @param x0 - Optional initial guess (if none, starts from bounds center)
|
|
684
|
+
* @param bounds - Required bounds for all variables
|
|
685
|
+
* @param config - Algorithm configuration
|
|
686
|
+
* @returns Optimization result with best solution
|
|
687
|
+
*/
|
|
688
|
+
export declare const scipy_optimize_dual_annealing: import("@elaraai/east").PlatformDefinition<[FunctionType<[VectorType<FloatType>], FloatType>, OptionType<VectorType<FloatType>>, StructType<{
|
|
689
|
+
/** Lower bounds for each variable */
|
|
690
|
+
readonly lower: VectorType<FloatType>;
|
|
691
|
+
/** Upper bounds for each variable */
|
|
692
|
+
readonly upper: VectorType<FloatType>;
|
|
693
|
+
}>, StructType<{
|
|
694
|
+
/** Maximum function evaluations (default: 1000) */
|
|
695
|
+
readonly maxfun: OptionType<IntegerType>;
|
|
696
|
+
/** Maximum iterations (default: 1000) */
|
|
697
|
+
readonly maxiter: OptionType<IntegerType>;
|
|
698
|
+
/** Initial temperature (default: 5230) */
|
|
699
|
+
readonly initial_temp: OptionType<FloatType>;
|
|
700
|
+
/** Temperature restart threshold (default: 2e-5) */
|
|
701
|
+
readonly restart_temp_ratio: OptionType<FloatType>;
|
|
702
|
+
/** Visiting distribution parameter (default: 2.62) */
|
|
703
|
+
readonly visit: OptionType<FloatType>;
|
|
704
|
+
/** Acceptance distribution parameter (default: -5.0) */
|
|
705
|
+
readonly accept: OptionType<FloatType>;
|
|
706
|
+
/** Random seed for reproducibility */
|
|
707
|
+
readonly seed: OptionType<IntegerType>;
|
|
708
|
+
/** Disable local search for speed (default: false) */
|
|
709
|
+
readonly no_local_search: OptionType<BooleanType>;
|
|
710
|
+
}>], StructType<{
|
|
711
|
+
/** Best solution found */
|
|
712
|
+
readonly x: VectorType<FloatType>;
|
|
713
|
+
/** Best objective value */
|
|
714
|
+
readonly fun: FloatType;
|
|
715
|
+
/** Number of function evaluations */
|
|
716
|
+
readonly nfev: IntegerType;
|
|
717
|
+
/** Number of iterations */
|
|
718
|
+
readonly nit: IntegerType;
|
|
719
|
+
/** Whether optimization succeeded */
|
|
720
|
+
readonly success: BooleanType;
|
|
721
|
+
/** Status message */
|
|
722
|
+
readonly message: StringType;
|
|
723
|
+
}>>;
|
|
724
|
+
/**
|
|
725
|
+
* Compute histogram of data using numpy.histogram.
|
|
726
|
+
*/
|
|
727
|
+
export declare const scipy_histogram: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, StructType<{
|
|
728
|
+
/** Number of bins (default 10) */
|
|
729
|
+
readonly bins: OptionType<IntegerType>;
|
|
730
|
+
/** Auto bin method (overrides bins if set) */
|
|
731
|
+
readonly bin_method: OptionType<VariantType<{
|
|
732
|
+
/** Maximum of Sturges and FD estimators */
|
|
733
|
+
readonly auto: NullType;
|
|
734
|
+
/** Freedman-Diaconis estimator */
|
|
735
|
+
readonly fd: NullType;
|
|
736
|
+
/** Sturges estimator */
|
|
737
|
+
readonly sturges: NullType;
|
|
738
|
+
/** Scott's normal reference rule */
|
|
739
|
+
readonly scott: NullType;
|
|
740
|
+
/** Rice estimator */
|
|
741
|
+
readonly rice: NullType;
|
|
742
|
+
/** Square root estimator */
|
|
743
|
+
readonly sqrt: NullType;
|
|
744
|
+
/** Doane's estimator */
|
|
745
|
+
readonly doane: NullType;
|
|
746
|
+
}>>;
|
|
747
|
+
/** Lower bound */
|
|
748
|
+
readonly range_min: OptionType<FloatType>;
|
|
749
|
+
/** Upper bound */
|
|
750
|
+
readonly range_max: OptionType<FloatType>;
|
|
751
|
+
/** Normalize to probability density */
|
|
752
|
+
readonly density: OptionType<BooleanType>;
|
|
753
|
+
/** Per-element weights */
|
|
754
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
755
|
+
}>], StructType<{
|
|
756
|
+
/** Bin values (float to support density mode) */
|
|
757
|
+
readonly counts: VectorType<FloatType>;
|
|
758
|
+
/** Bin edges (length = len(counts) + 1) */
|
|
759
|
+
readonly bin_edges: VectorType<FloatType>;
|
|
760
|
+
}>>;
|
|
761
|
+
/**
|
|
762
|
+
* Fit a Kernel Density Estimator to data.
|
|
763
|
+
*/
|
|
764
|
+
export declare const scipy_kde_fit: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, StructType<{
|
|
765
|
+
/** Bandwidth selection method (default scott) */
|
|
766
|
+
readonly bandwidth: OptionType<VariantType<{
|
|
767
|
+
/** Scott's rule of thumb (default) */
|
|
768
|
+
readonly scott: NullType;
|
|
769
|
+
/** Silverman's rule of thumb */
|
|
770
|
+
readonly silverman: NullType;
|
|
771
|
+
}>>;
|
|
772
|
+
/** Custom scalar bandwidth (overrides method if set) */
|
|
773
|
+
readonly bandwidth_scalar: OptionType<FloatType>;
|
|
774
|
+
/** Per-datapoint weights */
|
|
775
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
776
|
+
}>], VariantType<{
|
|
777
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
778
|
+
readonly scipy_interp_1d: StructType<{
|
|
779
|
+
/** Serialized interpolator */
|
|
780
|
+
readonly data: BlobType;
|
|
781
|
+
/** Interpolation method used */
|
|
782
|
+
readonly kind: VariantType<{
|
|
783
|
+
/** Linear interpolation (default) */
|
|
784
|
+
readonly linear: NullType;
|
|
785
|
+
/** Cubic interpolation */
|
|
786
|
+
readonly cubic: NullType;
|
|
787
|
+
/** Quadratic interpolation */
|
|
788
|
+
readonly quadratic: NullType;
|
|
789
|
+
}>;
|
|
790
|
+
}>;
|
|
791
|
+
/** KDE model (cloudpickle serialized) */
|
|
792
|
+
readonly scipy_kde: StructType<{
|
|
793
|
+
/** Serialized KDE model */
|
|
794
|
+
readonly data: BlobType;
|
|
795
|
+
/** KDE metadata */
|
|
796
|
+
readonly metadata: StructType<{
|
|
797
|
+
/** Actual bandwidth factor used */
|
|
798
|
+
readonly bandwidth: FloatType;
|
|
799
|
+
/** Minimum of training data */
|
|
800
|
+
readonly data_min: FloatType;
|
|
801
|
+
/** Maximum of training data */
|
|
802
|
+
readonly data_max: FloatType;
|
|
803
|
+
}>;
|
|
804
|
+
}>;
|
|
805
|
+
}>>;
|
|
806
|
+
/**
|
|
807
|
+
* Evaluate a fitted KDE model at given points.
|
|
808
|
+
*/
|
|
809
|
+
export declare const scipy_kde_evaluate: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
810
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
811
|
+
readonly scipy_interp_1d: StructType<{
|
|
812
|
+
/** Serialized interpolator */
|
|
813
|
+
readonly data: BlobType;
|
|
814
|
+
/** Interpolation method used */
|
|
815
|
+
readonly kind: VariantType<{
|
|
816
|
+
/** Linear interpolation (default) */
|
|
817
|
+
readonly linear: NullType;
|
|
818
|
+
/** Cubic interpolation */
|
|
819
|
+
readonly cubic: NullType;
|
|
820
|
+
/** Quadratic interpolation */
|
|
821
|
+
readonly quadratic: NullType;
|
|
822
|
+
}>;
|
|
823
|
+
}>;
|
|
824
|
+
/** KDE model (cloudpickle serialized) */
|
|
825
|
+
readonly scipy_kde: StructType<{
|
|
826
|
+
/** Serialized KDE model */
|
|
827
|
+
readonly data: BlobType;
|
|
828
|
+
/** KDE metadata */
|
|
829
|
+
readonly metadata: StructType<{
|
|
830
|
+
/** Actual bandwidth factor used */
|
|
831
|
+
readonly bandwidth: FloatType;
|
|
832
|
+
/** Minimum of training data */
|
|
833
|
+
readonly data_min: FloatType;
|
|
834
|
+
/** Maximum of training data */
|
|
835
|
+
readonly data_max: FloatType;
|
|
836
|
+
}>;
|
|
837
|
+
}>;
|
|
838
|
+
}>, VectorType<FloatType>], VectorType<FloatType>>;
|
|
839
|
+
/**
|
|
840
|
+
* Type definitions for scipy functions.
|
|
841
|
+
*/
|
|
842
|
+
export declare const ScipyTypes: {
|
|
843
|
+
readonly ScalarObjectiveType: FunctionType<[VectorType<FloatType>], FloatType>;
|
|
844
|
+
readonly OptimizeMethodType: VariantType<{
|
|
845
|
+
/** BFGS algorithm */
|
|
846
|
+
readonly bfgs: NullType;
|
|
847
|
+
/** L-BFGS-B algorithm (default) */
|
|
848
|
+
readonly l_bfgs_b: NullType;
|
|
849
|
+
/** Nelder-Mead simplex */
|
|
850
|
+
readonly nelder_mead: NullType;
|
|
851
|
+
/** Powell's method */
|
|
852
|
+
readonly powell: NullType;
|
|
853
|
+
/** Conjugate gradient */
|
|
854
|
+
readonly cg: NullType;
|
|
855
|
+
}>;
|
|
856
|
+
readonly InterpolationKindType: VariantType<{
|
|
857
|
+
/** Linear interpolation (default) */
|
|
858
|
+
readonly linear: NullType;
|
|
859
|
+
/** Cubic interpolation */
|
|
860
|
+
readonly cubic: NullType;
|
|
861
|
+
/** Quadratic interpolation */
|
|
862
|
+
readonly quadratic: NullType;
|
|
863
|
+
}>;
|
|
864
|
+
readonly HistogramBinMethodType: VariantType<{
|
|
865
|
+
/** Maximum of Sturges and FD estimators */
|
|
866
|
+
readonly auto: NullType;
|
|
867
|
+
/** Freedman-Diaconis estimator */
|
|
868
|
+
readonly fd: NullType;
|
|
869
|
+
/** Sturges estimator */
|
|
870
|
+
readonly sturges: NullType;
|
|
871
|
+
/** Scott's normal reference rule */
|
|
872
|
+
readonly scott: NullType;
|
|
873
|
+
/** Rice estimator */
|
|
874
|
+
readonly rice: NullType;
|
|
875
|
+
/** Square root estimator */
|
|
876
|
+
readonly sqrt: NullType;
|
|
877
|
+
/** Doane's estimator */
|
|
878
|
+
readonly doane: NullType;
|
|
879
|
+
}>;
|
|
880
|
+
readonly KdeBandwidthMethodType: VariantType<{
|
|
881
|
+
/** Scott's rule of thumb (default) */
|
|
882
|
+
readonly scott: NullType;
|
|
883
|
+
/** Silverman's rule of thumb */
|
|
884
|
+
readonly silverman: NullType;
|
|
885
|
+
}>;
|
|
886
|
+
readonly OptimizeConfigType: StructType<{
|
|
887
|
+
/** Optimization method */
|
|
888
|
+
readonly method: OptionType<VariantType<{
|
|
889
|
+
/** BFGS algorithm */
|
|
890
|
+
readonly bfgs: NullType;
|
|
891
|
+
/** L-BFGS-B algorithm (default) */
|
|
892
|
+
readonly l_bfgs_b: NullType;
|
|
893
|
+
/** Nelder-Mead simplex */
|
|
894
|
+
readonly nelder_mead: NullType;
|
|
895
|
+
/** Powell's method */
|
|
896
|
+
readonly powell: NullType;
|
|
897
|
+
/** Conjugate gradient */
|
|
898
|
+
readonly cg: NullType;
|
|
899
|
+
}>>;
|
|
900
|
+
/** Maximum number of iterations */
|
|
901
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
902
|
+
/** Tolerance for convergence */
|
|
903
|
+
readonly tol: OptionType<FloatType>;
|
|
904
|
+
}>;
|
|
905
|
+
readonly InterpolateConfigType: StructType<{
|
|
906
|
+
/** Interpolation method */
|
|
907
|
+
readonly kind: OptionType<VariantType<{
|
|
908
|
+
/** Linear interpolation (default) */
|
|
909
|
+
readonly linear: NullType;
|
|
910
|
+
/** Cubic interpolation */
|
|
911
|
+
readonly cubic: NullType;
|
|
912
|
+
/** Quadratic interpolation */
|
|
913
|
+
readonly quadratic: NullType;
|
|
914
|
+
}>>;
|
|
915
|
+
}>;
|
|
916
|
+
readonly HistogramConfigType: StructType<{
|
|
917
|
+
/** Number of bins (default 10) */
|
|
918
|
+
readonly bins: OptionType<IntegerType>;
|
|
919
|
+
/** Auto bin method (overrides bins if set) */
|
|
920
|
+
readonly bin_method: OptionType<VariantType<{
|
|
921
|
+
/** Maximum of Sturges and FD estimators */
|
|
922
|
+
readonly auto: NullType;
|
|
923
|
+
/** Freedman-Diaconis estimator */
|
|
924
|
+
readonly fd: NullType;
|
|
925
|
+
/** Sturges estimator */
|
|
926
|
+
readonly sturges: NullType;
|
|
927
|
+
/** Scott's normal reference rule */
|
|
928
|
+
readonly scott: NullType;
|
|
929
|
+
/** Rice estimator */
|
|
930
|
+
readonly rice: NullType;
|
|
931
|
+
/** Square root estimator */
|
|
932
|
+
readonly sqrt: NullType;
|
|
933
|
+
/** Doane's estimator */
|
|
934
|
+
readonly doane: NullType;
|
|
935
|
+
}>>;
|
|
936
|
+
/** Lower bound */
|
|
937
|
+
readonly range_min: OptionType<FloatType>;
|
|
938
|
+
/** Upper bound */
|
|
939
|
+
readonly range_max: OptionType<FloatType>;
|
|
940
|
+
/** Normalize to probability density */
|
|
941
|
+
readonly density: OptionType<BooleanType>;
|
|
942
|
+
/** Per-element weights */
|
|
943
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
944
|
+
}>;
|
|
945
|
+
readonly KdeConfigType: StructType<{
|
|
946
|
+
/** Bandwidth selection method (default scott) */
|
|
947
|
+
readonly bandwidth: OptionType<VariantType<{
|
|
948
|
+
/** Scott's rule of thumb (default) */
|
|
949
|
+
readonly scott: NullType;
|
|
950
|
+
/** Silverman's rule of thumb */
|
|
951
|
+
readonly silverman: NullType;
|
|
952
|
+
}>>;
|
|
953
|
+
/** Custom scalar bandwidth (overrides method if set) */
|
|
954
|
+
readonly bandwidth_scalar: OptionType<FloatType>;
|
|
955
|
+
/** Per-datapoint weights */
|
|
956
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
957
|
+
}>;
|
|
958
|
+
readonly ParamBoundsType: StructType<{
|
|
959
|
+
/** Lower bounds for each parameter */
|
|
960
|
+
readonly lower: VectorType<FloatType>;
|
|
961
|
+
/** Upper bounds for each parameter */
|
|
962
|
+
readonly upper: VectorType<FloatType>;
|
|
963
|
+
}>;
|
|
964
|
+
readonly CustomCurveFunctionType: FunctionType<[FloatType, VectorType<FloatType>, VectorType<FloatType>], FloatType>;
|
|
965
|
+
readonly CurveFunctionType: VariantType<{
|
|
966
|
+
/** y = a * exp(-b * x), 2 params: [a, b] */
|
|
967
|
+
readonly exponential_decay: NullType;
|
|
968
|
+
/** y = a + b * exp(-c * x), 3 params: [a, b, c] */
|
|
969
|
+
readonly exponential_with_offset: NullType;
|
|
970
|
+
/** y = a * exp(b * x), 2 params: [a, b] */
|
|
971
|
+
readonly exponential_growth: NullType;
|
|
972
|
+
/** y = L / (1 + exp(-k * (x - x0))), 3 params: [L, k, x0] */
|
|
973
|
+
readonly logistic: NullType;
|
|
974
|
+
/** y = a * exp(-b * exp(-c * x)), 3 params: [a, b, c] */
|
|
975
|
+
readonly gompertz: NullType;
|
|
976
|
+
/** y = a * x^b, 2 params: [a, b] */
|
|
977
|
+
readonly power_law: NullType;
|
|
978
|
+
/** y = a + b * x, 2 params: [a, b] */
|
|
979
|
+
readonly linear: NullType;
|
|
980
|
+
/** y = a + b*x + c*x^2, 3 params: [a, b, c] */
|
|
981
|
+
readonly quadratic: NullType;
|
|
982
|
+
/** y = a + b*x + c*x^2 + d*x^3, 4 params: [a, b, c, d] */
|
|
983
|
+
readonly cubic: NullType;
|
|
984
|
+
/** Custom function provided by user */
|
|
985
|
+
readonly custom: StructType<{
|
|
986
|
+
/** The curve function: (x, params, fixed_params) -> y */
|
|
987
|
+
readonly fn: FunctionType<[FloatType, VectorType<FloatType>, VectorType<FloatType>], FloatType>;
|
|
988
|
+
/** Number of parameters to optimize */
|
|
989
|
+
readonly n_params: IntegerType;
|
|
990
|
+
/** Optional parameter bounds */
|
|
991
|
+
readonly param_bounds: OptionType<StructType<{
|
|
992
|
+
/** Lower bounds for each parameter */
|
|
993
|
+
readonly lower: VectorType<FloatType>;
|
|
994
|
+
/** Upper bounds for each parameter */
|
|
995
|
+
readonly upper: VectorType<FloatType>;
|
|
996
|
+
}>>;
|
|
997
|
+
/** Optional fixed parameters passed to fn but not optimized */
|
|
998
|
+
readonly fixed_params: OptionType<VectorType<FloatType>>;
|
|
999
|
+
}>;
|
|
1000
|
+
}>;
|
|
1001
|
+
readonly CurveFitConfigType: StructType<{
|
|
1002
|
+
/** Maximum number of function evaluations */
|
|
1003
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
1004
|
+
/** Initial guess for parameters */
|
|
1005
|
+
readonly initial_guess: OptionType<VectorType<FloatType>>;
|
|
1006
|
+
}>;
|
|
1007
|
+
readonly QuadraticConfigType: StructType<{
|
|
1008
|
+
/** Quadratic term (symmetric positive definite) */
|
|
1009
|
+
readonly A: MatrixType<FloatType>;
|
|
1010
|
+
/** Linear term */
|
|
1011
|
+
readonly b: VectorType<FloatType>;
|
|
1012
|
+
/** Constant term */
|
|
1013
|
+
readonly c: FloatType;
|
|
1014
|
+
}>;
|
|
1015
|
+
readonly StatsDescribeResultType: StructType<{
|
|
1016
|
+
/** Number of observations */
|
|
1017
|
+
readonly count: IntegerType;
|
|
1018
|
+
/** Mean value */
|
|
1019
|
+
readonly mean: FloatType;
|
|
1020
|
+
/** Variance */
|
|
1021
|
+
readonly variance: FloatType;
|
|
1022
|
+
/** Skewness */
|
|
1023
|
+
readonly skewness: FloatType;
|
|
1024
|
+
/** Kurtosis */
|
|
1025
|
+
readonly kurtosis: FloatType;
|
|
1026
|
+
/** Minimum value */
|
|
1027
|
+
readonly min: FloatType;
|
|
1028
|
+
/** Maximum value */
|
|
1029
|
+
readonly max: FloatType;
|
|
1030
|
+
}>;
|
|
1031
|
+
readonly RobustStatsResultType: StructType<{
|
|
1032
|
+
/** Median value */
|
|
1033
|
+
readonly median: FloatType;
|
|
1034
|
+
/** Interquartile range (Q3 - Q1) */
|
|
1035
|
+
readonly iqr: FloatType;
|
|
1036
|
+
/** Median absolute deviation */
|
|
1037
|
+
readonly mad: FloatType;
|
|
1038
|
+
/** 25th percentile */
|
|
1039
|
+
readonly q1: FloatType;
|
|
1040
|
+
/** 75th percentile */
|
|
1041
|
+
readonly q3: FloatType;
|
|
1042
|
+
}>;
|
|
1043
|
+
readonly CorrelationResultType: StructType<{
|
|
1044
|
+
/** Correlation coefficient */
|
|
1045
|
+
readonly correlation: FloatType;
|
|
1046
|
+
/** P-value for hypothesis test */
|
|
1047
|
+
readonly pvalue: FloatType;
|
|
1048
|
+
}>;
|
|
1049
|
+
readonly CurveFitResultType: StructType<{
|
|
1050
|
+
/** Fitted parameters */
|
|
1051
|
+
readonly params: VectorType<FloatType>;
|
|
1052
|
+
/** Whether fit converged */
|
|
1053
|
+
readonly success: BooleanType;
|
|
1054
|
+
/** Coefficient of determination (R²) */
|
|
1055
|
+
readonly r_squared: FloatType;
|
|
1056
|
+
}>;
|
|
1057
|
+
readonly OptimizeResultType: StructType<{
|
|
1058
|
+
/** Optimal parameters */
|
|
1059
|
+
readonly x: VectorType<FloatType>;
|
|
1060
|
+
/** Function value at optimum */
|
|
1061
|
+
readonly fun: FloatType;
|
|
1062
|
+
/** Whether optimization succeeded */
|
|
1063
|
+
readonly success: BooleanType;
|
|
1064
|
+
/** Number of iterations */
|
|
1065
|
+
readonly nit: IntegerType;
|
|
1066
|
+
}>;
|
|
1067
|
+
readonly HistogramResultType: StructType<{
|
|
1068
|
+
/** Bin values (float to support density mode) */
|
|
1069
|
+
readonly counts: VectorType<FloatType>;
|
|
1070
|
+
/** Bin edges (length = len(counts) + 1) */
|
|
1071
|
+
readonly bin_edges: VectorType<FloatType>;
|
|
1072
|
+
}>;
|
|
1073
|
+
readonly KdeResultType: StructType<{
|
|
1074
|
+
/** Actual bandwidth factor used */
|
|
1075
|
+
readonly bandwidth: FloatType;
|
|
1076
|
+
/** Minimum of training data */
|
|
1077
|
+
readonly data_min: FloatType;
|
|
1078
|
+
/** Maximum of training data */
|
|
1079
|
+
readonly data_max: FloatType;
|
|
1080
|
+
}>;
|
|
1081
|
+
readonly ModelBlobType: VariantType<{
|
|
1082
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
1083
|
+
readonly scipy_interp_1d: StructType<{
|
|
1084
|
+
/** Serialized interpolator */
|
|
1085
|
+
readonly data: BlobType;
|
|
1086
|
+
/** Interpolation method used */
|
|
1087
|
+
readonly kind: VariantType<{
|
|
1088
|
+
/** Linear interpolation (default) */
|
|
1089
|
+
readonly linear: NullType;
|
|
1090
|
+
/** Cubic interpolation */
|
|
1091
|
+
readonly cubic: NullType;
|
|
1092
|
+
/** Quadratic interpolation */
|
|
1093
|
+
readonly quadratic: NullType;
|
|
1094
|
+
}>;
|
|
1095
|
+
}>;
|
|
1096
|
+
/** KDE model (cloudpickle serialized) */
|
|
1097
|
+
readonly scipy_kde: StructType<{
|
|
1098
|
+
/** Serialized KDE model */
|
|
1099
|
+
readonly data: BlobType;
|
|
1100
|
+
/** KDE metadata */
|
|
1101
|
+
readonly metadata: StructType<{
|
|
1102
|
+
/** Actual bandwidth factor used */
|
|
1103
|
+
readonly bandwidth: FloatType;
|
|
1104
|
+
/** Minimum of training data */
|
|
1105
|
+
readonly data_min: FloatType;
|
|
1106
|
+
/** Maximum of training data */
|
|
1107
|
+
readonly data_max: FloatType;
|
|
1108
|
+
}>;
|
|
1109
|
+
}>;
|
|
1110
|
+
}>;
|
|
1111
|
+
readonly DualAnnealBoundsType: StructType<{
|
|
1112
|
+
/** Lower bounds for each variable */
|
|
1113
|
+
readonly lower: VectorType<FloatType>;
|
|
1114
|
+
/** Upper bounds for each variable */
|
|
1115
|
+
readonly upper: VectorType<FloatType>;
|
|
1116
|
+
}>;
|
|
1117
|
+
readonly DualAnnealConfigType: StructType<{
|
|
1118
|
+
/** Maximum function evaluations (default: 1000) */
|
|
1119
|
+
readonly maxfun: OptionType<IntegerType>;
|
|
1120
|
+
/** Maximum iterations (default: 1000) */
|
|
1121
|
+
readonly maxiter: OptionType<IntegerType>;
|
|
1122
|
+
/** Initial temperature (default: 5230) */
|
|
1123
|
+
readonly initial_temp: OptionType<FloatType>;
|
|
1124
|
+
/** Temperature restart threshold (default: 2e-5) */
|
|
1125
|
+
readonly restart_temp_ratio: OptionType<FloatType>;
|
|
1126
|
+
/** Visiting distribution parameter (default: 2.62) */
|
|
1127
|
+
readonly visit: OptionType<FloatType>;
|
|
1128
|
+
/** Acceptance distribution parameter (default: -5.0) */
|
|
1129
|
+
readonly accept: OptionType<FloatType>;
|
|
1130
|
+
/** Random seed for reproducibility */
|
|
1131
|
+
readonly seed: OptionType<IntegerType>;
|
|
1132
|
+
/** Disable local search for speed (default: false) */
|
|
1133
|
+
readonly no_local_search: OptionType<BooleanType>;
|
|
1134
|
+
}>;
|
|
1135
|
+
readonly DualAnnealResultType: StructType<{
|
|
1136
|
+
/** Best solution found */
|
|
1137
|
+
readonly x: VectorType<FloatType>;
|
|
1138
|
+
/** Best objective value */
|
|
1139
|
+
readonly fun: FloatType;
|
|
1140
|
+
/** Number of function evaluations */
|
|
1141
|
+
readonly nfev: IntegerType;
|
|
1142
|
+
/** Number of iterations */
|
|
1143
|
+
readonly nit: IntegerType;
|
|
1144
|
+
/** Whether optimization succeeded */
|
|
1145
|
+
readonly success: BooleanType;
|
|
1146
|
+
/** Status message */
|
|
1147
|
+
readonly message: StringType;
|
|
1148
|
+
}>;
|
|
1149
|
+
};
|
|
1150
|
+
/**
|
|
1151
|
+
* SciPy scientific computing utilities.
|
|
1152
|
+
*
|
|
1153
|
+
* Provides statistics, optimization, interpolation, and curve fitting.
|
|
1154
|
+
*/
|
|
1155
|
+
export declare const Scipy: {
|
|
1156
|
+
/**
|
|
1157
|
+
* Fit a parametric curve to data using nonlinear least squares.
|
|
1158
|
+
*
|
|
1159
|
+
* @example
|
|
1160
|
+
* ```ts
|
|
1161
|
+
* import { East, FloatType, variant } from "@elaraai/east";
|
|
1162
|
+
* import { Scipy, VectorType, CurveFitConfigType } from "@elaraai/east-py-datascience";
|
|
1163
|
+
*
|
|
1164
|
+
* const fit = East.function(
|
|
1165
|
+
* [VectorType(FloatType), VectorType(FloatType)],
|
|
1166
|
+
* Scipy.Types.CurveFitResultType,
|
|
1167
|
+
* ($, x, y) => {
|
|
1168
|
+
* const func = $.let(variant("exponential_decay", null), Scipy.Types.CurveFunctionType);
|
|
1169
|
+
* const config = $.let({
|
|
1170
|
+
* max_iter: variant("none", null),
|
|
1171
|
+
* initial_guess: variant("none", null),
|
|
1172
|
+
* }, CurveFitConfigType);
|
|
1173
|
+
* return $.return(Scipy.curveFit(func, x, y, config));
|
|
1174
|
+
* }
|
|
1175
|
+
* );
|
|
1176
|
+
* ```
|
|
1177
|
+
*/
|
|
1178
|
+
readonly curveFit: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
1179
|
+
/** y = a * exp(-b * x), 2 params: [a, b] */
|
|
1180
|
+
readonly exponential_decay: NullType;
|
|
1181
|
+
/** y = a + b * exp(-c * x), 3 params: [a, b, c] */
|
|
1182
|
+
readonly exponential_with_offset: NullType;
|
|
1183
|
+
/** y = a * exp(b * x), 2 params: [a, b] */
|
|
1184
|
+
readonly exponential_growth: NullType;
|
|
1185
|
+
/** y = L / (1 + exp(-k * (x - x0))), 3 params: [L, k, x0] */
|
|
1186
|
+
readonly logistic: NullType;
|
|
1187
|
+
/** y = a * exp(-b * exp(-c * x)), 3 params: [a, b, c] */
|
|
1188
|
+
readonly gompertz: NullType;
|
|
1189
|
+
/** y = a * x^b, 2 params: [a, b] */
|
|
1190
|
+
readonly power_law: NullType;
|
|
1191
|
+
/** y = a + b * x, 2 params: [a, b] */
|
|
1192
|
+
readonly linear: NullType;
|
|
1193
|
+
/** y = a + b*x + c*x^2, 3 params: [a, b, c] */
|
|
1194
|
+
readonly quadratic: NullType;
|
|
1195
|
+
/** y = a + b*x + c*x^2 + d*x^3, 4 params: [a, b, c, d] */
|
|
1196
|
+
readonly cubic: NullType;
|
|
1197
|
+
/** Custom function provided by user */
|
|
1198
|
+
readonly custom: StructType<{
|
|
1199
|
+
/** The curve function: (x, params, fixed_params) -> y */
|
|
1200
|
+
readonly fn: FunctionType<[FloatType, VectorType<FloatType>, VectorType<FloatType>], FloatType>;
|
|
1201
|
+
/** Number of parameters to optimize */
|
|
1202
|
+
readonly n_params: IntegerType;
|
|
1203
|
+
/** Optional parameter bounds */
|
|
1204
|
+
readonly param_bounds: OptionType<StructType<{
|
|
1205
|
+
/** Lower bounds for each parameter */
|
|
1206
|
+
readonly lower: VectorType<FloatType>;
|
|
1207
|
+
/** Upper bounds for each parameter */
|
|
1208
|
+
readonly upper: VectorType<FloatType>;
|
|
1209
|
+
}>>;
|
|
1210
|
+
/** Optional fixed parameters passed to fn but not optimized */
|
|
1211
|
+
readonly fixed_params: OptionType<VectorType<FloatType>>;
|
|
1212
|
+
}>;
|
|
1213
|
+
}>, VectorType<FloatType>, VectorType<FloatType>, StructType<{
|
|
1214
|
+
/** Maximum number of function evaluations */
|
|
1215
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
1216
|
+
/** Initial guess for parameters */
|
|
1217
|
+
readonly initial_guess: OptionType<VectorType<FloatType>>;
|
|
1218
|
+
}>], StructType<{
|
|
1219
|
+
/** Fitted parameters */
|
|
1220
|
+
readonly params: VectorType<FloatType>;
|
|
1221
|
+
/** Whether fit converged */
|
|
1222
|
+
readonly success: BooleanType;
|
|
1223
|
+
/** Coefficient of determination (R²) */
|
|
1224
|
+
readonly r_squared: FloatType;
|
|
1225
|
+
}>>;
|
|
1226
|
+
/**
|
|
1227
|
+
* Compute descriptive statistics for data.
|
|
1228
|
+
*
|
|
1229
|
+
* @example
|
|
1230
|
+
* ```ts
|
|
1231
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1232
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1233
|
+
*
|
|
1234
|
+
* const describe = East.function(
|
|
1235
|
+
* [VectorType(FloatType)],
|
|
1236
|
+
* Scipy.Types.StatsDescribeResultType,
|
|
1237
|
+
* ($, data) => {
|
|
1238
|
+
* const result = $.let(Scipy.statsDescribe(data));
|
|
1239
|
+
* // result.mean, result.variance, result.skewness, etc.
|
|
1240
|
+
* return $.return(result);
|
|
1241
|
+
* }
|
|
1242
|
+
* );
|
|
1243
|
+
* ```
|
|
1244
|
+
*/
|
|
1245
|
+
readonly statsDescribe: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], StructType<{
|
|
1246
|
+
/** Number of observations */
|
|
1247
|
+
readonly count: IntegerType;
|
|
1248
|
+
/** Mean value */
|
|
1249
|
+
readonly mean: FloatType;
|
|
1250
|
+
/** Variance */
|
|
1251
|
+
readonly variance: FloatType;
|
|
1252
|
+
/** Skewness */
|
|
1253
|
+
readonly skewness: FloatType;
|
|
1254
|
+
/** Kurtosis */
|
|
1255
|
+
readonly kurtosis: FloatType;
|
|
1256
|
+
/** Minimum value */
|
|
1257
|
+
readonly min: FloatType;
|
|
1258
|
+
/** Maximum value */
|
|
1259
|
+
readonly max: FloatType;
|
|
1260
|
+
}>>;
|
|
1261
|
+
/**
|
|
1262
|
+
* Compute Pearson correlation coefficient.
|
|
1263
|
+
*
|
|
1264
|
+
* @example
|
|
1265
|
+
* ```ts
|
|
1266
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1267
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1268
|
+
*
|
|
1269
|
+
* const correlate = East.function(
|
|
1270
|
+
* [VectorType(FloatType), VectorType(FloatType)],
|
|
1271
|
+
* Scipy.Types.CorrelationResultType,
|
|
1272
|
+
* ($, x, y) => {
|
|
1273
|
+
* const result = $.let(Scipy.statsPearsonr(x, y));
|
|
1274
|
+
* // result.correlation, result.pvalue
|
|
1275
|
+
* return $.return(result);
|
|
1276
|
+
* }
|
|
1277
|
+
* );
|
|
1278
|
+
* ```
|
|
1279
|
+
*/
|
|
1280
|
+
readonly statsPearsonr: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, VectorType<FloatType>], StructType<{
|
|
1281
|
+
/** Correlation coefficient */
|
|
1282
|
+
readonly correlation: FloatType;
|
|
1283
|
+
/** P-value for hypothesis test */
|
|
1284
|
+
readonly pvalue: FloatType;
|
|
1285
|
+
}>>;
|
|
1286
|
+
/**
|
|
1287
|
+
* Compute Spearman rank correlation.
|
|
1288
|
+
*
|
|
1289
|
+
* @example
|
|
1290
|
+
* ```ts
|
|
1291
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1292
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1293
|
+
*
|
|
1294
|
+
* const correlate = East.function(
|
|
1295
|
+
* [VectorType(FloatType), VectorType(FloatType)],
|
|
1296
|
+
* Scipy.Types.CorrelationResultType,
|
|
1297
|
+
* ($, x, y) => {
|
|
1298
|
+
* const result = $.let(Scipy.statsSpearmanr(x, y));
|
|
1299
|
+
* // result.correlation, result.pvalue
|
|
1300
|
+
* return $.return(result);
|
|
1301
|
+
* }
|
|
1302
|
+
* );
|
|
1303
|
+
* ```
|
|
1304
|
+
*/
|
|
1305
|
+
readonly statsSpearmanr: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, VectorType<FloatType>], StructType<{
|
|
1306
|
+
/** Correlation coefficient */
|
|
1307
|
+
readonly correlation: FloatType;
|
|
1308
|
+
/** P-value for hypothesis test */
|
|
1309
|
+
readonly pvalue: FloatType;
|
|
1310
|
+
}>>;
|
|
1311
|
+
/**
|
|
1312
|
+
* Compute percentiles of data.
|
|
1313
|
+
*
|
|
1314
|
+
* @example
|
|
1315
|
+
* ```ts
|
|
1316
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1317
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1318
|
+
*
|
|
1319
|
+
* const getPercentiles = East.function(
|
|
1320
|
+
* [VectorType(FloatType)],
|
|
1321
|
+
* VectorType(FloatType),
|
|
1322
|
+
* ($, data) => {
|
|
1323
|
+
* const percentiles = $.let(new Float64Array([25.0, 50.0, 75.0]));
|
|
1324
|
+
* return $.return(Scipy.statsPercentile(data, percentiles));
|
|
1325
|
+
* }
|
|
1326
|
+
* );
|
|
1327
|
+
* ```
|
|
1328
|
+
*/
|
|
1329
|
+
readonly statsPercentile: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, VectorType<FloatType>], VectorType<FloatType>>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Compute the percentile rank of a score relative to a dataset.
|
|
1332
|
+
*
|
|
1333
|
+
* @example
|
|
1334
|
+
* ```ts
|
|
1335
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1336
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1337
|
+
*
|
|
1338
|
+
* const getPctRank = East.function(
|
|
1339
|
+
* [VectorType(FloatType), FloatType],
|
|
1340
|
+
* FloatType,
|
|
1341
|
+
* ($, data, score) => {
|
|
1342
|
+
* return $.return(Scipy.statsPercentileOfScore(data, score));
|
|
1343
|
+
* }
|
|
1344
|
+
* );
|
|
1345
|
+
* ```
|
|
1346
|
+
*/
|
|
1347
|
+
readonly statsPercentileOfScore: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, FloatType], FloatType>;
|
|
1348
|
+
/**
|
|
1349
|
+
* Compute interquartile range (Q3 - Q1).
|
|
1350
|
+
*
|
|
1351
|
+
* @example
|
|
1352
|
+
* ```ts
|
|
1353
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1354
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1355
|
+
*
|
|
1356
|
+
* const getIqr = East.function(
|
|
1357
|
+
* [VectorType(FloatType)],
|
|
1358
|
+
* FloatType,
|
|
1359
|
+
* ($, data) => {
|
|
1360
|
+
* return $.return(Scipy.statsIqr(data));
|
|
1361
|
+
* }
|
|
1362
|
+
* );
|
|
1363
|
+
* ```
|
|
1364
|
+
*/
|
|
1365
|
+
readonly statsIqr: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], FloatType>;
|
|
1366
|
+
/**
|
|
1367
|
+
* Compute median value.
|
|
1368
|
+
*
|
|
1369
|
+
* @example
|
|
1370
|
+
* ```ts
|
|
1371
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1372
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1373
|
+
*
|
|
1374
|
+
* const getMedian = East.function(
|
|
1375
|
+
* [VectorType(FloatType)],
|
|
1376
|
+
* FloatType,
|
|
1377
|
+
* ($, data) => {
|
|
1378
|
+
* return $.return(Scipy.statsMedian(data));
|
|
1379
|
+
* }
|
|
1380
|
+
* );
|
|
1381
|
+
* ```
|
|
1382
|
+
*/
|
|
1383
|
+
readonly statsMedian: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], FloatType>;
|
|
1384
|
+
/**
|
|
1385
|
+
* Compute median absolute deviation (robust std estimate).
|
|
1386
|
+
*
|
|
1387
|
+
* @example
|
|
1388
|
+
* ```ts
|
|
1389
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1390
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1391
|
+
*
|
|
1392
|
+
* const getMad = East.function(
|
|
1393
|
+
* [VectorType(FloatType)],
|
|
1394
|
+
* FloatType,
|
|
1395
|
+
* ($, data) => {
|
|
1396
|
+
* return $.return(Scipy.statsMad(data));
|
|
1397
|
+
* }
|
|
1398
|
+
* );
|
|
1399
|
+
* ```
|
|
1400
|
+
*/
|
|
1401
|
+
readonly statsMad: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], FloatType>;
|
|
1402
|
+
/**
|
|
1403
|
+
* Compute robust statistics in one call (median, iqr, mad, q1, q3).
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1406
|
+
* ```ts
|
|
1407
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1408
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1409
|
+
*
|
|
1410
|
+
* const getRobust = East.function(
|
|
1411
|
+
* [VectorType(FloatType)],
|
|
1412
|
+
* Scipy.Types.RobustStatsResultType,
|
|
1413
|
+
* ($, data) => {
|
|
1414
|
+
* const result = $.let(Scipy.statsRobust(data));
|
|
1415
|
+
* // result.median, result.iqr, result.mad, result.q1, result.q3
|
|
1416
|
+
* return $.return(result);
|
|
1417
|
+
* }
|
|
1418
|
+
* );
|
|
1419
|
+
* ```
|
|
1420
|
+
*/
|
|
1421
|
+
readonly statsRobust: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>], StructType<{
|
|
1422
|
+
/** Median value */
|
|
1423
|
+
readonly median: FloatType;
|
|
1424
|
+
/** Interquartile range (Q3 - Q1) */
|
|
1425
|
+
readonly iqr: FloatType;
|
|
1426
|
+
/** Median absolute deviation */
|
|
1427
|
+
readonly mad: FloatType;
|
|
1428
|
+
/** 25th percentile */
|
|
1429
|
+
readonly q1: FloatType;
|
|
1430
|
+
/** 75th percentile */
|
|
1431
|
+
readonly q3: FloatType;
|
|
1432
|
+
}>>;
|
|
1433
|
+
/**
|
|
1434
|
+
* Fit a 1D interpolator to data.
|
|
1435
|
+
*
|
|
1436
|
+
* @example
|
|
1437
|
+
* ```ts
|
|
1438
|
+
* import { East, FloatType, variant } from "@elaraai/east";
|
|
1439
|
+
* import { Scipy, VectorType, InterpolateConfigType } from "@elaraai/east-py-datascience";
|
|
1440
|
+
*
|
|
1441
|
+
* const fitInterp = East.function(
|
|
1442
|
+
* [VectorType(FloatType), VectorType(FloatType)],
|
|
1443
|
+
* Scipy.Types.ModelBlobType,
|
|
1444
|
+
* ($, x, y) => {
|
|
1445
|
+
* const config = $.let({
|
|
1446
|
+
* kind: variant("some", variant("cubic", null)),
|
|
1447
|
+
* }, InterpolateConfigType);
|
|
1448
|
+
* return $.return(Scipy.interpolate1dFit(x, y, config));
|
|
1449
|
+
* }
|
|
1450
|
+
* );
|
|
1451
|
+
* ```
|
|
1452
|
+
*/
|
|
1453
|
+
readonly interpolate1dFit: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, VectorType<FloatType>, StructType<{
|
|
1454
|
+
/** Interpolation method */
|
|
1455
|
+
readonly kind: OptionType<VariantType<{
|
|
1456
|
+
/** Linear interpolation (default) */
|
|
1457
|
+
readonly linear: NullType;
|
|
1458
|
+
/** Cubic interpolation */
|
|
1459
|
+
readonly cubic: NullType;
|
|
1460
|
+
/** Quadratic interpolation */
|
|
1461
|
+
readonly quadratic: NullType;
|
|
1462
|
+
}>>;
|
|
1463
|
+
}>], VariantType<{
|
|
1464
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
1465
|
+
readonly scipy_interp_1d: StructType<{
|
|
1466
|
+
/** Serialized interpolator */
|
|
1467
|
+
readonly data: BlobType;
|
|
1468
|
+
/** Interpolation method used */
|
|
1469
|
+
readonly kind: VariantType<{
|
|
1470
|
+
/** Linear interpolation (default) */
|
|
1471
|
+
readonly linear: NullType;
|
|
1472
|
+
/** Cubic interpolation */
|
|
1473
|
+
readonly cubic: NullType;
|
|
1474
|
+
/** Quadratic interpolation */
|
|
1475
|
+
readonly quadratic: NullType;
|
|
1476
|
+
}>;
|
|
1477
|
+
}>;
|
|
1478
|
+
/** KDE model (cloudpickle serialized) */
|
|
1479
|
+
readonly scipy_kde: StructType<{
|
|
1480
|
+
/** Serialized KDE model */
|
|
1481
|
+
readonly data: BlobType;
|
|
1482
|
+
/** KDE metadata */
|
|
1483
|
+
readonly metadata: StructType<{
|
|
1484
|
+
/** Actual bandwidth factor used */
|
|
1485
|
+
readonly bandwidth: FloatType;
|
|
1486
|
+
/** Minimum of training data */
|
|
1487
|
+
readonly data_min: FloatType;
|
|
1488
|
+
/** Maximum of training data */
|
|
1489
|
+
readonly data_max: FloatType;
|
|
1490
|
+
}>;
|
|
1491
|
+
}>;
|
|
1492
|
+
}>>;
|
|
1493
|
+
/**
|
|
1494
|
+
* Evaluate a fitted 1D interpolator at given points.
|
|
1495
|
+
*
|
|
1496
|
+
* @example
|
|
1497
|
+
* ```ts
|
|
1498
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1499
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1500
|
+
*
|
|
1501
|
+
* const predict = East.function(
|
|
1502
|
+
* [Scipy.Types.ModelBlobType, VectorType(FloatType)],
|
|
1503
|
+
* VectorType(FloatType),
|
|
1504
|
+
* ($, model, x_new) => {
|
|
1505
|
+
* return $.return(Scipy.interpolate1dPredict(model, x_new));
|
|
1506
|
+
* }
|
|
1507
|
+
* );
|
|
1508
|
+
* ```
|
|
1509
|
+
*/
|
|
1510
|
+
readonly interpolate1dPredict: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
1511
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
1512
|
+
readonly scipy_interp_1d: StructType<{
|
|
1513
|
+
/** Serialized interpolator */
|
|
1514
|
+
readonly data: BlobType;
|
|
1515
|
+
/** Interpolation method used */
|
|
1516
|
+
readonly kind: VariantType<{
|
|
1517
|
+
/** Linear interpolation (default) */
|
|
1518
|
+
readonly linear: NullType;
|
|
1519
|
+
/** Cubic interpolation */
|
|
1520
|
+
readonly cubic: NullType;
|
|
1521
|
+
/** Quadratic interpolation */
|
|
1522
|
+
readonly quadratic: NullType;
|
|
1523
|
+
}>;
|
|
1524
|
+
}>;
|
|
1525
|
+
/** KDE model (cloudpickle serialized) */
|
|
1526
|
+
readonly scipy_kde: StructType<{
|
|
1527
|
+
/** Serialized KDE model */
|
|
1528
|
+
readonly data: BlobType;
|
|
1529
|
+
/** KDE metadata */
|
|
1530
|
+
readonly metadata: StructType<{
|
|
1531
|
+
/** Actual bandwidth factor used */
|
|
1532
|
+
readonly bandwidth: FloatType;
|
|
1533
|
+
/** Minimum of training data */
|
|
1534
|
+
readonly data_min: FloatType;
|
|
1535
|
+
/** Maximum of training data */
|
|
1536
|
+
readonly data_max: FloatType;
|
|
1537
|
+
}>;
|
|
1538
|
+
}>;
|
|
1539
|
+
}>, VectorType<FloatType>], VectorType<FloatType>>;
|
|
1540
|
+
/**
|
|
1541
|
+
* Minimize a scalar function using scipy.optimize.minimize.
|
|
1542
|
+
*
|
|
1543
|
+
* @example
|
|
1544
|
+
* ```ts
|
|
1545
|
+
* import { East, FloatType, variant } from "@elaraai/east";
|
|
1546
|
+
* import { Scipy, VectorType, ScalarObjectiveType, OptimizeConfigType } from "@elaraai/east-py-datascience";
|
|
1547
|
+
*
|
|
1548
|
+
* const optimize = East.function(
|
|
1549
|
+
* [ScalarObjectiveType, VectorType(FloatType)],
|
|
1550
|
+
* Scipy.Types.OptimizeResultType,
|
|
1551
|
+
* ($, objective, x0) => {
|
|
1552
|
+
* const config = $.let({
|
|
1553
|
+
* method: variant("some", variant("l_bfgs_b", null)),
|
|
1554
|
+
* max_iter: variant("some", 100n),
|
|
1555
|
+
* tol: variant("none", null),
|
|
1556
|
+
* }, OptimizeConfigType);
|
|
1557
|
+
* return $.return(Scipy.optimizeMinimize(objective, x0, config));
|
|
1558
|
+
* }
|
|
1559
|
+
* );
|
|
1560
|
+
* ```
|
|
1561
|
+
*/
|
|
1562
|
+
readonly optimizeMinimize: import("@elaraai/east").PlatformDefinition<[FunctionType<[VectorType<FloatType>], FloatType>, VectorType<FloatType>, StructType<{
|
|
1563
|
+
/** Optimization method */
|
|
1564
|
+
readonly method: OptionType<VariantType<{
|
|
1565
|
+
/** BFGS algorithm */
|
|
1566
|
+
readonly bfgs: NullType;
|
|
1567
|
+
/** L-BFGS-B algorithm (default) */
|
|
1568
|
+
readonly l_bfgs_b: NullType;
|
|
1569
|
+
/** Nelder-Mead simplex */
|
|
1570
|
+
readonly nelder_mead: NullType;
|
|
1571
|
+
/** Powell's method */
|
|
1572
|
+
readonly powell: NullType;
|
|
1573
|
+
/** Conjugate gradient */
|
|
1574
|
+
readonly cg: NullType;
|
|
1575
|
+
}>>;
|
|
1576
|
+
/** Maximum number of iterations */
|
|
1577
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
1578
|
+
/** Tolerance for convergence */
|
|
1579
|
+
readonly tol: OptionType<FloatType>;
|
|
1580
|
+
}>], StructType<{
|
|
1581
|
+
/** Optimal parameters */
|
|
1582
|
+
readonly x: VectorType<FloatType>;
|
|
1583
|
+
/** Function value at optimum */
|
|
1584
|
+
readonly fun: FloatType;
|
|
1585
|
+
/** Whether optimization succeeded */
|
|
1586
|
+
readonly success: BooleanType;
|
|
1587
|
+
/** Number of iterations */
|
|
1588
|
+
readonly nit: IntegerType;
|
|
1589
|
+
}>>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Minimize a quadratic function with analytical gradient.
|
|
1592
|
+
*
|
|
1593
|
+
* Minimizes f(x) = 0.5 * x'Ax + b'x + c.
|
|
1594
|
+
*
|
|
1595
|
+
* @example
|
|
1596
|
+
* ```ts
|
|
1597
|
+
* import { East, FloatType, variant } from "@elaraai/east";
|
|
1598
|
+
* import { Scipy, VectorType, MatrixType, QuadraticConfigType, OptimizeConfigType } from "@elaraai/east-py-datascience";
|
|
1599
|
+
*
|
|
1600
|
+
* const optimize = East.function(
|
|
1601
|
+
* [VectorType(FloatType)],
|
|
1602
|
+
* Scipy.Types.OptimizeResultType,
|
|
1603
|
+
* ($, x0) => {
|
|
1604
|
+
* const quadConfig = $.let({
|
|
1605
|
+
* A: [[2.0, 0.0], [0.0, 2.0]],
|
|
1606
|
+
* b: new Float64Array([-4.0, -6.0]),
|
|
1607
|
+
* c: 0.0,
|
|
1608
|
+
* }, QuadraticConfigType);
|
|
1609
|
+
* const config = $.let({
|
|
1610
|
+
* method: variant("some", variant("l_bfgs_b", null)),
|
|
1611
|
+
* max_iter: variant("none", null),
|
|
1612
|
+
* tol: variant("none", null),
|
|
1613
|
+
* }, OptimizeConfigType);
|
|
1614
|
+
* return $.return(Scipy.optimizeMinimizeQuadratic(x0, quadConfig, config));
|
|
1615
|
+
* }
|
|
1616
|
+
* );
|
|
1617
|
+
* ```
|
|
1618
|
+
*/
|
|
1619
|
+
readonly optimizeMinimizeQuadratic: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, StructType<{
|
|
1620
|
+
/** Quadratic term (symmetric positive definite) */
|
|
1621
|
+
readonly A: MatrixType<FloatType>;
|
|
1622
|
+
/** Linear term */
|
|
1623
|
+
readonly b: VectorType<FloatType>;
|
|
1624
|
+
/** Constant term */
|
|
1625
|
+
readonly c: FloatType;
|
|
1626
|
+
}>, StructType<{
|
|
1627
|
+
/** Optimization method */
|
|
1628
|
+
readonly method: OptionType<VariantType<{
|
|
1629
|
+
/** BFGS algorithm */
|
|
1630
|
+
readonly bfgs: NullType;
|
|
1631
|
+
/** L-BFGS-B algorithm (default) */
|
|
1632
|
+
readonly l_bfgs_b: NullType;
|
|
1633
|
+
/** Nelder-Mead simplex */
|
|
1634
|
+
readonly nelder_mead: NullType;
|
|
1635
|
+
/** Powell's method */
|
|
1636
|
+
readonly powell: NullType;
|
|
1637
|
+
/** Conjugate gradient */
|
|
1638
|
+
readonly cg: NullType;
|
|
1639
|
+
}>>;
|
|
1640
|
+
/** Maximum number of iterations */
|
|
1641
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
1642
|
+
/** Tolerance for convergence */
|
|
1643
|
+
readonly tol: OptionType<FloatType>;
|
|
1644
|
+
}>], StructType<{
|
|
1645
|
+
/** Optimal parameters */
|
|
1646
|
+
readonly x: VectorType<FloatType>;
|
|
1647
|
+
/** Function value at optimum */
|
|
1648
|
+
readonly fun: FloatType;
|
|
1649
|
+
/** Whether optimization succeeded */
|
|
1650
|
+
readonly success: BooleanType;
|
|
1651
|
+
/** Number of iterations */
|
|
1652
|
+
readonly nit: IntegerType;
|
|
1653
|
+
}>>;
|
|
1654
|
+
/**
|
|
1655
|
+
* Global optimization using dual annealing.
|
|
1656
|
+
*
|
|
1657
|
+
* Combines generalized simulated annealing with local search.
|
|
1658
|
+
*
|
|
1659
|
+
* @example
|
|
1660
|
+
* ```ts
|
|
1661
|
+
* import { East, FloatType, variant } from "@elaraai/east";
|
|
1662
|
+
* import { Scipy, VectorType, ScalarObjectiveType, DualAnnealBoundsType, DualAnnealConfigType } from "@elaraai/east-py-datascience";
|
|
1663
|
+
*
|
|
1664
|
+
* const optimize = East.function(
|
|
1665
|
+
* [ScalarObjectiveType],
|
|
1666
|
+
* Scipy.Types.DualAnnealResultType,
|
|
1667
|
+
* ($, objective) => {
|
|
1668
|
+
* const bounds = $.let({
|
|
1669
|
+
* lower: new Float64Array([-5.0, -5.0]),
|
|
1670
|
+
* upper: new Float64Array([5.0, 5.0]),
|
|
1671
|
+
* }, DualAnnealBoundsType);
|
|
1672
|
+
* const config = $.let({
|
|
1673
|
+
* maxfun: variant("some", 1000n),
|
|
1674
|
+
* maxiter: variant("none", null),
|
|
1675
|
+
* initial_temp: variant("none", null),
|
|
1676
|
+
* restart_temp_ratio: variant("none", null),
|
|
1677
|
+
* visit: variant("none", null),
|
|
1678
|
+
* accept: variant("none", null),
|
|
1679
|
+
* seed: variant("some", 42n),
|
|
1680
|
+
* no_local_search: variant("none", null),
|
|
1681
|
+
* }, DualAnnealConfigType);
|
|
1682
|
+
* return $.return(Scipy.optimizeDualAnnealing(objective, variant("none", null), bounds, config));
|
|
1683
|
+
* }
|
|
1684
|
+
* );
|
|
1685
|
+
* ```
|
|
1686
|
+
*/
|
|
1687
|
+
readonly optimizeDualAnnealing: import("@elaraai/east").PlatformDefinition<[FunctionType<[VectorType<FloatType>], FloatType>, OptionType<VectorType<FloatType>>, StructType<{
|
|
1688
|
+
/** Lower bounds for each variable */
|
|
1689
|
+
readonly lower: VectorType<FloatType>;
|
|
1690
|
+
/** Upper bounds for each variable */
|
|
1691
|
+
readonly upper: VectorType<FloatType>;
|
|
1692
|
+
}>, StructType<{
|
|
1693
|
+
/** Maximum function evaluations (default: 1000) */
|
|
1694
|
+
readonly maxfun: OptionType<IntegerType>;
|
|
1695
|
+
/** Maximum iterations (default: 1000) */
|
|
1696
|
+
readonly maxiter: OptionType<IntegerType>;
|
|
1697
|
+
/** Initial temperature (default: 5230) */
|
|
1698
|
+
readonly initial_temp: OptionType<FloatType>;
|
|
1699
|
+
/** Temperature restart threshold (default: 2e-5) */
|
|
1700
|
+
readonly restart_temp_ratio: OptionType<FloatType>;
|
|
1701
|
+
/** Visiting distribution parameter (default: 2.62) */
|
|
1702
|
+
readonly visit: OptionType<FloatType>;
|
|
1703
|
+
/** Acceptance distribution parameter (default: -5.0) */
|
|
1704
|
+
readonly accept: OptionType<FloatType>;
|
|
1705
|
+
/** Random seed for reproducibility */
|
|
1706
|
+
readonly seed: OptionType<IntegerType>;
|
|
1707
|
+
/** Disable local search for speed (default: false) */
|
|
1708
|
+
readonly no_local_search: OptionType<BooleanType>;
|
|
1709
|
+
}>], StructType<{
|
|
1710
|
+
/** Best solution found */
|
|
1711
|
+
readonly x: VectorType<FloatType>;
|
|
1712
|
+
/** Best objective value */
|
|
1713
|
+
readonly fun: FloatType;
|
|
1714
|
+
/** Number of function evaluations */
|
|
1715
|
+
readonly nfev: IntegerType;
|
|
1716
|
+
/** Number of iterations */
|
|
1717
|
+
readonly nit: IntegerType;
|
|
1718
|
+
/** Whether optimization succeeded */
|
|
1719
|
+
readonly success: BooleanType;
|
|
1720
|
+
/** Status message */
|
|
1721
|
+
readonly message: StringType;
|
|
1722
|
+
}>>;
|
|
1723
|
+
/**
|
|
1724
|
+
* Compute histogram of data.
|
|
1725
|
+
*
|
|
1726
|
+
* @example
|
|
1727
|
+
* ```ts
|
|
1728
|
+
* import { East, FloatType, variant } from "@elaraai/east";
|
|
1729
|
+
* import { Scipy, VectorType, HistogramConfigType } from "@elaraai/east-py-datascience";
|
|
1730
|
+
*
|
|
1731
|
+
* const computeHist = East.function(
|
|
1732
|
+
* [VectorType(FloatType)],
|
|
1733
|
+
* Scipy.Types.HistogramResultType,
|
|
1734
|
+
* ($, data) => {
|
|
1735
|
+
* const config = $.let({
|
|
1736
|
+
* bins: variant("some", 20n),
|
|
1737
|
+
* bin_method: variant("none", null),
|
|
1738
|
+
* range_min: variant("none", null),
|
|
1739
|
+
* range_max: variant("none", null),
|
|
1740
|
+
* density: variant("some", true),
|
|
1741
|
+
* weights: variant("none", null),
|
|
1742
|
+
* }, HistogramConfigType);
|
|
1743
|
+
* const result = $.let(Scipy.histogram(data, config));
|
|
1744
|
+
* // result.counts, result.bin_edges
|
|
1745
|
+
* return $.return(result);
|
|
1746
|
+
* }
|
|
1747
|
+
* );
|
|
1748
|
+
* ```
|
|
1749
|
+
*/
|
|
1750
|
+
readonly histogram: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, StructType<{
|
|
1751
|
+
/** Number of bins (default 10) */
|
|
1752
|
+
readonly bins: OptionType<IntegerType>;
|
|
1753
|
+
/** Auto bin method (overrides bins if set) */
|
|
1754
|
+
readonly bin_method: OptionType<VariantType<{
|
|
1755
|
+
/** Maximum of Sturges and FD estimators */
|
|
1756
|
+
readonly auto: NullType;
|
|
1757
|
+
/** Freedman-Diaconis estimator */
|
|
1758
|
+
readonly fd: NullType;
|
|
1759
|
+
/** Sturges estimator */
|
|
1760
|
+
readonly sturges: NullType;
|
|
1761
|
+
/** Scott's normal reference rule */
|
|
1762
|
+
readonly scott: NullType;
|
|
1763
|
+
/** Rice estimator */
|
|
1764
|
+
readonly rice: NullType;
|
|
1765
|
+
/** Square root estimator */
|
|
1766
|
+
readonly sqrt: NullType;
|
|
1767
|
+
/** Doane's estimator */
|
|
1768
|
+
readonly doane: NullType;
|
|
1769
|
+
}>>;
|
|
1770
|
+
/** Lower bound */
|
|
1771
|
+
readonly range_min: OptionType<FloatType>;
|
|
1772
|
+
/** Upper bound */
|
|
1773
|
+
readonly range_max: OptionType<FloatType>;
|
|
1774
|
+
/** Normalize to probability density */
|
|
1775
|
+
readonly density: OptionType<BooleanType>;
|
|
1776
|
+
/** Per-element weights */
|
|
1777
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
1778
|
+
}>], StructType<{
|
|
1779
|
+
/** Bin values (float to support density mode) */
|
|
1780
|
+
readonly counts: VectorType<FloatType>;
|
|
1781
|
+
/** Bin edges (length = len(counts) + 1) */
|
|
1782
|
+
readonly bin_edges: VectorType<FloatType>;
|
|
1783
|
+
}>>;
|
|
1784
|
+
/**
|
|
1785
|
+
* Fit a Kernel Density Estimator to data.
|
|
1786
|
+
*
|
|
1787
|
+
* @example
|
|
1788
|
+
* ```ts
|
|
1789
|
+
* import { East, FloatType, variant } from "@elaraai/east";
|
|
1790
|
+
* import { Scipy, VectorType, KdeConfigType } from "@elaraai/east-py-datascience";
|
|
1791
|
+
*
|
|
1792
|
+
* const fitKde = East.function(
|
|
1793
|
+
* [VectorType(FloatType)],
|
|
1794
|
+
* Scipy.Types.ModelBlobType,
|
|
1795
|
+
* ($, data) => {
|
|
1796
|
+
* const config = $.let({
|
|
1797
|
+
* bandwidth: variant("some", variant("scott", null)),
|
|
1798
|
+
* bandwidth_scalar: variant("none", null),
|
|
1799
|
+
* weights: variant("none", null),
|
|
1800
|
+
* }, KdeConfigType);
|
|
1801
|
+
* return $.return(Scipy.kdeFit(data, config));
|
|
1802
|
+
* }
|
|
1803
|
+
* );
|
|
1804
|
+
* ```
|
|
1805
|
+
*/
|
|
1806
|
+
readonly kdeFit: import("@elaraai/east").PlatformDefinition<[VectorType<FloatType>, StructType<{
|
|
1807
|
+
/** Bandwidth selection method (default scott) */
|
|
1808
|
+
readonly bandwidth: OptionType<VariantType<{
|
|
1809
|
+
/** Scott's rule of thumb (default) */
|
|
1810
|
+
readonly scott: NullType;
|
|
1811
|
+
/** Silverman's rule of thumb */
|
|
1812
|
+
readonly silverman: NullType;
|
|
1813
|
+
}>>;
|
|
1814
|
+
/** Custom scalar bandwidth (overrides method if set) */
|
|
1815
|
+
readonly bandwidth_scalar: OptionType<FloatType>;
|
|
1816
|
+
/** Per-datapoint weights */
|
|
1817
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
1818
|
+
}>], VariantType<{
|
|
1819
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
1820
|
+
readonly scipy_interp_1d: StructType<{
|
|
1821
|
+
/** Serialized interpolator */
|
|
1822
|
+
readonly data: BlobType;
|
|
1823
|
+
/** Interpolation method used */
|
|
1824
|
+
readonly kind: VariantType<{
|
|
1825
|
+
/** Linear interpolation (default) */
|
|
1826
|
+
readonly linear: NullType;
|
|
1827
|
+
/** Cubic interpolation */
|
|
1828
|
+
readonly cubic: NullType;
|
|
1829
|
+
/** Quadratic interpolation */
|
|
1830
|
+
readonly quadratic: NullType;
|
|
1831
|
+
}>;
|
|
1832
|
+
}>;
|
|
1833
|
+
/** KDE model (cloudpickle serialized) */
|
|
1834
|
+
readonly scipy_kde: StructType<{
|
|
1835
|
+
/** Serialized KDE model */
|
|
1836
|
+
readonly data: BlobType;
|
|
1837
|
+
/** KDE metadata */
|
|
1838
|
+
readonly metadata: StructType<{
|
|
1839
|
+
/** Actual bandwidth factor used */
|
|
1840
|
+
readonly bandwidth: FloatType;
|
|
1841
|
+
/** Minimum of training data */
|
|
1842
|
+
readonly data_min: FloatType;
|
|
1843
|
+
/** Maximum of training data */
|
|
1844
|
+
readonly data_max: FloatType;
|
|
1845
|
+
}>;
|
|
1846
|
+
}>;
|
|
1847
|
+
}>>;
|
|
1848
|
+
/**
|
|
1849
|
+
* Evaluate a fitted KDE model at given points.
|
|
1850
|
+
*
|
|
1851
|
+
* @example
|
|
1852
|
+
* ```ts
|
|
1853
|
+
* import { East, FloatType } from "@elaraai/east";
|
|
1854
|
+
* import { Scipy, VectorType } from "@elaraai/east-py-datascience";
|
|
1855
|
+
*
|
|
1856
|
+
* const evaluate = East.function(
|
|
1857
|
+
* [Scipy.Types.ModelBlobType, VectorType(FloatType)],
|
|
1858
|
+
* VectorType(FloatType),
|
|
1859
|
+
* ($, model, points) => {
|
|
1860
|
+
* return $.return(Scipy.kdeEvaluate(model, points));
|
|
1861
|
+
* }
|
|
1862
|
+
* );
|
|
1863
|
+
* ```
|
|
1864
|
+
*/
|
|
1865
|
+
readonly kdeEvaluate: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
1866
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
1867
|
+
readonly scipy_interp_1d: StructType<{
|
|
1868
|
+
/** Serialized interpolator */
|
|
1869
|
+
readonly data: BlobType;
|
|
1870
|
+
/** Interpolation method used */
|
|
1871
|
+
readonly kind: VariantType<{
|
|
1872
|
+
/** Linear interpolation (default) */
|
|
1873
|
+
readonly linear: NullType;
|
|
1874
|
+
/** Cubic interpolation */
|
|
1875
|
+
readonly cubic: NullType;
|
|
1876
|
+
/** Quadratic interpolation */
|
|
1877
|
+
readonly quadratic: NullType;
|
|
1878
|
+
}>;
|
|
1879
|
+
}>;
|
|
1880
|
+
/** KDE model (cloudpickle serialized) */
|
|
1881
|
+
readonly scipy_kde: StructType<{
|
|
1882
|
+
/** Serialized KDE model */
|
|
1883
|
+
readonly data: BlobType;
|
|
1884
|
+
/** KDE metadata */
|
|
1885
|
+
readonly metadata: StructType<{
|
|
1886
|
+
/** Actual bandwidth factor used */
|
|
1887
|
+
readonly bandwidth: FloatType;
|
|
1888
|
+
/** Minimum of training data */
|
|
1889
|
+
readonly data_min: FloatType;
|
|
1890
|
+
/** Maximum of training data */
|
|
1891
|
+
readonly data_max: FloatType;
|
|
1892
|
+
}>;
|
|
1893
|
+
}>;
|
|
1894
|
+
}>, VectorType<FloatType>], VectorType<FloatType>>;
|
|
1895
|
+
/** Type definitions */
|
|
1896
|
+
readonly Types: {
|
|
1897
|
+
readonly ScalarObjectiveType: FunctionType<[VectorType<FloatType>], FloatType>;
|
|
1898
|
+
readonly OptimizeMethodType: VariantType<{
|
|
1899
|
+
/** BFGS algorithm */
|
|
1900
|
+
readonly bfgs: NullType;
|
|
1901
|
+
/** L-BFGS-B algorithm (default) */
|
|
1902
|
+
readonly l_bfgs_b: NullType;
|
|
1903
|
+
/** Nelder-Mead simplex */
|
|
1904
|
+
readonly nelder_mead: NullType;
|
|
1905
|
+
/** Powell's method */
|
|
1906
|
+
readonly powell: NullType;
|
|
1907
|
+
/** Conjugate gradient */
|
|
1908
|
+
readonly cg: NullType;
|
|
1909
|
+
}>;
|
|
1910
|
+
readonly InterpolationKindType: VariantType<{
|
|
1911
|
+
/** Linear interpolation (default) */
|
|
1912
|
+
readonly linear: NullType;
|
|
1913
|
+
/** Cubic interpolation */
|
|
1914
|
+
readonly cubic: NullType;
|
|
1915
|
+
/** Quadratic interpolation */
|
|
1916
|
+
readonly quadratic: NullType;
|
|
1917
|
+
}>;
|
|
1918
|
+
readonly HistogramBinMethodType: VariantType<{
|
|
1919
|
+
/** Maximum of Sturges and FD estimators */
|
|
1920
|
+
readonly auto: NullType;
|
|
1921
|
+
/** Freedman-Diaconis estimator */
|
|
1922
|
+
readonly fd: NullType;
|
|
1923
|
+
/** Sturges estimator */
|
|
1924
|
+
readonly sturges: NullType;
|
|
1925
|
+
/** Scott's normal reference rule */
|
|
1926
|
+
readonly scott: NullType;
|
|
1927
|
+
/** Rice estimator */
|
|
1928
|
+
readonly rice: NullType;
|
|
1929
|
+
/** Square root estimator */
|
|
1930
|
+
readonly sqrt: NullType;
|
|
1931
|
+
/** Doane's estimator */
|
|
1932
|
+
readonly doane: NullType;
|
|
1933
|
+
}>;
|
|
1934
|
+
readonly KdeBandwidthMethodType: VariantType<{
|
|
1935
|
+
/** Scott's rule of thumb (default) */
|
|
1936
|
+
readonly scott: NullType;
|
|
1937
|
+
/** Silverman's rule of thumb */
|
|
1938
|
+
readonly silverman: NullType;
|
|
1939
|
+
}>;
|
|
1940
|
+
readonly OptimizeConfigType: StructType<{
|
|
1941
|
+
/** Optimization method */
|
|
1942
|
+
readonly method: OptionType<VariantType<{
|
|
1943
|
+
/** BFGS algorithm */
|
|
1944
|
+
readonly bfgs: NullType;
|
|
1945
|
+
/** L-BFGS-B algorithm (default) */
|
|
1946
|
+
readonly l_bfgs_b: NullType;
|
|
1947
|
+
/** Nelder-Mead simplex */
|
|
1948
|
+
readonly nelder_mead: NullType;
|
|
1949
|
+
/** Powell's method */
|
|
1950
|
+
readonly powell: NullType;
|
|
1951
|
+
/** Conjugate gradient */
|
|
1952
|
+
readonly cg: NullType;
|
|
1953
|
+
}>>;
|
|
1954
|
+
/** Maximum number of iterations */
|
|
1955
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
1956
|
+
/** Tolerance for convergence */
|
|
1957
|
+
readonly tol: OptionType<FloatType>;
|
|
1958
|
+
}>;
|
|
1959
|
+
readonly InterpolateConfigType: StructType<{
|
|
1960
|
+
/** Interpolation method */
|
|
1961
|
+
readonly kind: OptionType<VariantType<{
|
|
1962
|
+
/** Linear interpolation (default) */
|
|
1963
|
+
readonly linear: NullType;
|
|
1964
|
+
/** Cubic interpolation */
|
|
1965
|
+
readonly cubic: NullType;
|
|
1966
|
+
/** Quadratic interpolation */
|
|
1967
|
+
readonly quadratic: NullType;
|
|
1968
|
+
}>>;
|
|
1969
|
+
}>;
|
|
1970
|
+
readonly HistogramConfigType: StructType<{
|
|
1971
|
+
/** Number of bins (default 10) */
|
|
1972
|
+
readonly bins: OptionType<IntegerType>;
|
|
1973
|
+
/** Auto bin method (overrides bins if set) */
|
|
1974
|
+
readonly bin_method: OptionType<VariantType<{
|
|
1975
|
+
/** Maximum of Sturges and FD estimators */
|
|
1976
|
+
readonly auto: NullType;
|
|
1977
|
+
/** Freedman-Diaconis estimator */
|
|
1978
|
+
readonly fd: NullType;
|
|
1979
|
+
/** Sturges estimator */
|
|
1980
|
+
readonly sturges: NullType;
|
|
1981
|
+
/** Scott's normal reference rule */
|
|
1982
|
+
readonly scott: NullType;
|
|
1983
|
+
/** Rice estimator */
|
|
1984
|
+
readonly rice: NullType;
|
|
1985
|
+
/** Square root estimator */
|
|
1986
|
+
readonly sqrt: NullType;
|
|
1987
|
+
/** Doane's estimator */
|
|
1988
|
+
readonly doane: NullType;
|
|
1989
|
+
}>>;
|
|
1990
|
+
/** Lower bound */
|
|
1991
|
+
readonly range_min: OptionType<FloatType>;
|
|
1992
|
+
/** Upper bound */
|
|
1993
|
+
readonly range_max: OptionType<FloatType>;
|
|
1994
|
+
/** Normalize to probability density */
|
|
1995
|
+
readonly density: OptionType<BooleanType>;
|
|
1996
|
+
/** Per-element weights */
|
|
1997
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
1998
|
+
}>;
|
|
1999
|
+
readonly KdeConfigType: StructType<{
|
|
2000
|
+
/** Bandwidth selection method (default scott) */
|
|
2001
|
+
readonly bandwidth: OptionType<VariantType<{
|
|
2002
|
+
/** Scott's rule of thumb (default) */
|
|
2003
|
+
readonly scott: NullType;
|
|
2004
|
+
/** Silverman's rule of thumb */
|
|
2005
|
+
readonly silverman: NullType;
|
|
2006
|
+
}>>;
|
|
2007
|
+
/** Custom scalar bandwidth (overrides method if set) */
|
|
2008
|
+
readonly bandwidth_scalar: OptionType<FloatType>;
|
|
2009
|
+
/** Per-datapoint weights */
|
|
2010
|
+
readonly weights: OptionType<VectorType<FloatType>>;
|
|
2011
|
+
}>;
|
|
2012
|
+
readonly ParamBoundsType: StructType<{
|
|
2013
|
+
/** Lower bounds for each parameter */
|
|
2014
|
+
readonly lower: VectorType<FloatType>;
|
|
2015
|
+
/** Upper bounds for each parameter */
|
|
2016
|
+
readonly upper: VectorType<FloatType>;
|
|
2017
|
+
}>;
|
|
2018
|
+
readonly CustomCurveFunctionType: FunctionType<[FloatType, VectorType<FloatType>, VectorType<FloatType>], FloatType>;
|
|
2019
|
+
readonly CurveFunctionType: VariantType<{
|
|
2020
|
+
/** y = a * exp(-b * x), 2 params: [a, b] */
|
|
2021
|
+
readonly exponential_decay: NullType;
|
|
2022
|
+
/** y = a + b * exp(-c * x), 3 params: [a, b, c] */
|
|
2023
|
+
readonly exponential_with_offset: NullType;
|
|
2024
|
+
/** y = a * exp(b * x), 2 params: [a, b] */
|
|
2025
|
+
readonly exponential_growth: NullType;
|
|
2026
|
+
/** y = L / (1 + exp(-k * (x - x0))), 3 params: [L, k, x0] */
|
|
2027
|
+
readonly logistic: NullType;
|
|
2028
|
+
/** y = a * exp(-b * exp(-c * x)), 3 params: [a, b, c] */
|
|
2029
|
+
readonly gompertz: NullType;
|
|
2030
|
+
/** y = a * x^b, 2 params: [a, b] */
|
|
2031
|
+
readonly power_law: NullType;
|
|
2032
|
+
/** y = a + b * x, 2 params: [a, b] */
|
|
2033
|
+
readonly linear: NullType;
|
|
2034
|
+
/** y = a + b*x + c*x^2, 3 params: [a, b, c] */
|
|
2035
|
+
readonly quadratic: NullType;
|
|
2036
|
+
/** y = a + b*x + c*x^2 + d*x^3, 4 params: [a, b, c, d] */
|
|
2037
|
+
readonly cubic: NullType;
|
|
2038
|
+
/** Custom function provided by user */
|
|
2039
|
+
readonly custom: StructType<{
|
|
2040
|
+
/** The curve function: (x, params, fixed_params) -> y */
|
|
2041
|
+
readonly fn: FunctionType<[FloatType, VectorType<FloatType>, VectorType<FloatType>], FloatType>;
|
|
2042
|
+
/** Number of parameters to optimize */
|
|
2043
|
+
readonly n_params: IntegerType;
|
|
2044
|
+
/** Optional parameter bounds */
|
|
2045
|
+
readonly param_bounds: OptionType<StructType<{
|
|
2046
|
+
/** Lower bounds for each parameter */
|
|
2047
|
+
readonly lower: VectorType<FloatType>;
|
|
2048
|
+
/** Upper bounds for each parameter */
|
|
2049
|
+
readonly upper: VectorType<FloatType>;
|
|
2050
|
+
}>>;
|
|
2051
|
+
/** Optional fixed parameters passed to fn but not optimized */
|
|
2052
|
+
readonly fixed_params: OptionType<VectorType<FloatType>>;
|
|
2053
|
+
}>;
|
|
2054
|
+
}>;
|
|
2055
|
+
readonly CurveFitConfigType: StructType<{
|
|
2056
|
+
/** Maximum number of function evaluations */
|
|
2057
|
+
readonly max_iter: OptionType<IntegerType>;
|
|
2058
|
+
/** Initial guess for parameters */
|
|
2059
|
+
readonly initial_guess: OptionType<VectorType<FloatType>>;
|
|
2060
|
+
}>;
|
|
2061
|
+
readonly QuadraticConfigType: StructType<{
|
|
2062
|
+
/** Quadratic term (symmetric positive definite) */
|
|
2063
|
+
readonly A: MatrixType<FloatType>;
|
|
2064
|
+
/** Linear term */
|
|
2065
|
+
readonly b: VectorType<FloatType>;
|
|
2066
|
+
/** Constant term */
|
|
2067
|
+
readonly c: FloatType;
|
|
2068
|
+
}>;
|
|
2069
|
+
readonly StatsDescribeResultType: StructType<{
|
|
2070
|
+
/** Number of observations */
|
|
2071
|
+
readonly count: IntegerType;
|
|
2072
|
+
/** Mean value */
|
|
2073
|
+
readonly mean: FloatType;
|
|
2074
|
+
/** Variance */
|
|
2075
|
+
readonly variance: FloatType;
|
|
2076
|
+
/** Skewness */
|
|
2077
|
+
readonly skewness: FloatType;
|
|
2078
|
+
/** Kurtosis */
|
|
2079
|
+
readonly kurtosis: FloatType;
|
|
2080
|
+
/** Minimum value */
|
|
2081
|
+
readonly min: FloatType;
|
|
2082
|
+
/** Maximum value */
|
|
2083
|
+
readonly max: FloatType;
|
|
2084
|
+
}>;
|
|
2085
|
+
readonly RobustStatsResultType: StructType<{
|
|
2086
|
+
/** Median value */
|
|
2087
|
+
readonly median: FloatType;
|
|
2088
|
+
/** Interquartile range (Q3 - Q1) */
|
|
2089
|
+
readonly iqr: FloatType;
|
|
2090
|
+
/** Median absolute deviation */
|
|
2091
|
+
readonly mad: FloatType;
|
|
2092
|
+
/** 25th percentile */
|
|
2093
|
+
readonly q1: FloatType;
|
|
2094
|
+
/** 75th percentile */
|
|
2095
|
+
readonly q3: FloatType;
|
|
2096
|
+
}>;
|
|
2097
|
+
readonly CorrelationResultType: StructType<{
|
|
2098
|
+
/** Correlation coefficient */
|
|
2099
|
+
readonly correlation: FloatType;
|
|
2100
|
+
/** P-value for hypothesis test */
|
|
2101
|
+
readonly pvalue: FloatType;
|
|
2102
|
+
}>;
|
|
2103
|
+
readonly CurveFitResultType: StructType<{
|
|
2104
|
+
/** Fitted parameters */
|
|
2105
|
+
readonly params: VectorType<FloatType>;
|
|
2106
|
+
/** Whether fit converged */
|
|
2107
|
+
readonly success: BooleanType;
|
|
2108
|
+
/** Coefficient of determination (R²) */
|
|
2109
|
+
readonly r_squared: FloatType;
|
|
2110
|
+
}>;
|
|
2111
|
+
readonly OptimizeResultType: StructType<{
|
|
2112
|
+
/** Optimal parameters */
|
|
2113
|
+
readonly x: VectorType<FloatType>;
|
|
2114
|
+
/** Function value at optimum */
|
|
2115
|
+
readonly fun: FloatType;
|
|
2116
|
+
/** Whether optimization succeeded */
|
|
2117
|
+
readonly success: BooleanType;
|
|
2118
|
+
/** Number of iterations */
|
|
2119
|
+
readonly nit: IntegerType;
|
|
2120
|
+
}>;
|
|
2121
|
+
readonly HistogramResultType: StructType<{
|
|
2122
|
+
/** Bin values (float to support density mode) */
|
|
2123
|
+
readonly counts: VectorType<FloatType>;
|
|
2124
|
+
/** Bin edges (length = len(counts) + 1) */
|
|
2125
|
+
readonly bin_edges: VectorType<FloatType>;
|
|
2126
|
+
}>;
|
|
2127
|
+
readonly KdeResultType: StructType<{
|
|
2128
|
+
/** Actual bandwidth factor used */
|
|
2129
|
+
readonly bandwidth: FloatType;
|
|
2130
|
+
/** Minimum of training data */
|
|
2131
|
+
readonly data_min: FloatType;
|
|
2132
|
+
/** Maximum of training data */
|
|
2133
|
+
readonly data_max: FloatType;
|
|
2134
|
+
}>;
|
|
2135
|
+
readonly ModelBlobType: VariantType<{
|
|
2136
|
+
/** 1D interpolator (cloudpickle serialized) */
|
|
2137
|
+
readonly scipy_interp_1d: StructType<{
|
|
2138
|
+
/** Serialized interpolator */
|
|
2139
|
+
readonly data: BlobType;
|
|
2140
|
+
/** Interpolation method used */
|
|
2141
|
+
readonly kind: VariantType<{
|
|
2142
|
+
/** Linear interpolation (default) */
|
|
2143
|
+
readonly linear: NullType;
|
|
2144
|
+
/** Cubic interpolation */
|
|
2145
|
+
readonly cubic: NullType;
|
|
2146
|
+
/** Quadratic interpolation */
|
|
2147
|
+
readonly quadratic: NullType;
|
|
2148
|
+
}>;
|
|
2149
|
+
}>;
|
|
2150
|
+
/** KDE model (cloudpickle serialized) */
|
|
2151
|
+
readonly scipy_kde: StructType<{
|
|
2152
|
+
/** Serialized KDE model */
|
|
2153
|
+
readonly data: BlobType;
|
|
2154
|
+
/** KDE metadata */
|
|
2155
|
+
readonly metadata: StructType<{
|
|
2156
|
+
/** Actual bandwidth factor used */
|
|
2157
|
+
readonly bandwidth: FloatType;
|
|
2158
|
+
/** Minimum of training data */
|
|
2159
|
+
readonly data_min: FloatType;
|
|
2160
|
+
/** Maximum of training data */
|
|
2161
|
+
readonly data_max: FloatType;
|
|
2162
|
+
}>;
|
|
2163
|
+
}>;
|
|
2164
|
+
}>;
|
|
2165
|
+
readonly DualAnnealBoundsType: StructType<{
|
|
2166
|
+
/** Lower bounds for each variable */
|
|
2167
|
+
readonly lower: VectorType<FloatType>;
|
|
2168
|
+
/** Upper bounds for each variable */
|
|
2169
|
+
readonly upper: VectorType<FloatType>;
|
|
2170
|
+
}>;
|
|
2171
|
+
readonly DualAnnealConfigType: StructType<{
|
|
2172
|
+
/** Maximum function evaluations (default: 1000) */
|
|
2173
|
+
readonly maxfun: OptionType<IntegerType>;
|
|
2174
|
+
/** Maximum iterations (default: 1000) */
|
|
2175
|
+
readonly maxiter: OptionType<IntegerType>;
|
|
2176
|
+
/** Initial temperature (default: 5230) */
|
|
2177
|
+
readonly initial_temp: OptionType<FloatType>;
|
|
2178
|
+
/** Temperature restart threshold (default: 2e-5) */
|
|
2179
|
+
readonly restart_temp_ratio: OptionType<FloatType>;
|
|
2180
|
+
/** Visiting distribution parameter (default: 2.62) */
|
|
2181
|
+
readonly visit: OptionType<FloatType>;
|
|
2182
|
+
/** Acceptance distribution parameter (default: -5.0) */
|
|
2183
|
+
readonly accept: OptionType<FloatType>;
|
|
2184
|
+
/** Random seed for reproducibility */
|
|
2185
|
+
readonly seed: OptionType<IntegerType>;
|
|
2186
|
+
/** Disable local search for speed (default: false) */
|
|
2187
|
+
readonly no_local_search: OptionType<BooleanType>;
|
|
2188
|
+
}>;
|
|
2189
|
+
readonly DualAnnealResultType: StructType<{
|
|
2190
|
+
/** Best solution found */
|
|
2191
|
+
readonly x: VectorType<FloatType>;
|
|
2192
|
+
/** Best objective value */
|
|
2193
|
+
readonly fun: FloatType;
|
|
2194
|
+
/** Number of function evaluations */
|
|
2195
|
+
readonly nfev: IntegerType;
|
|
2196
|
+
/** Number of iterations */
|
|
2197
|
+
readonly nit: IntegerType;
|
|
2198
|
+
/** Whether optimization succeeded */
|
|
2199
|
+
readonly success: BooleanType;
|
|
2200
|
+
/** Status message */
|
|
2201
|
+
readonly message: StringType;
|
|
2202
|
+
}>;
|
|
2203
|
+
};
|
|
2204
|
+
};
|
|
2205
|
+
//# sourceMappingURL=scipy.d.ts.map
|