@elaraai/east-py-datascience 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/src/alns/alns.d.ts +528 -0
  2. package/dist/src/alns/alns.d.ts.map +1 -0
  3. package/dist/src/alns/alns.js +238 -0
  4. package/dist/src/alns/alns.js.map +1 -0
  5. package/dist/src/google_or/google_or.d.ts +2457 -0
  6. package/dist/src/google_or/google_or.d.ts.map +1 -0
  7. package/dist/src/google_or/google_or.js +547 -0
  8. package/dist/src/google_or/google_or.js.map +1 -0
  9. package/dist/src/gp/gp.d.ts +447 -0
  10. package/dist/src/gp/gp.d.ts.map +1 -0
  11. package/dist/src/gp/gp.js +222 -0
  12. package/dist/src/gp/gp.js.map +1 -0
  13. package/dist/src/index.d.ts +34 -0
  14. package/dist/src/index.d.ts.map +1 -0
  15. package/dist/src/index.js +57 -0
  16. package/dist/src/index.js.map +1 -0
  17. package/dist/src/lightgbm/lightgbm.d.ts +575 -0
  18. package/dist/src/lightgbm/lightgbm.d.ts.map +1 -0
  19. package/dist/src/lightgbm/lightgbm.js +241 -0
  20. package/dist/src/lightgbm/lightgbm.js.map +1 -0
  21. package/dist/src/lightning/lightning.d.ts +1594 -0
  22. package/dist/src/lightning/lightning.d.ts.map +1 -0
  23. package/dist/src/lightning/lightning.js +468 -0
  24. package/dist/src/lightning/lightning.js.map +1 -0
  25. package/dist/src/mads/mads.d.ts +410 -0
  26. package/dist/src/mads/mads.d.ts.map +1 -0
  27. package/dist/src/mads/mads.js +219 -0
  28. package/dist/src/mads/mads.js.map +1 -0
  29. package/dist/src/mapie/mapie.d.ts +3680 -0
  30. package/dist/src/mapie/mapie.d.ts.map +1 -0
  31. package/dist/src/mapie/mapie.js +616 -0
  32. package/dist/src/mapie/mapie.js.map +1 -0
  33. package/dist/src/ngboost/ngboost.d.ts +483 -0
  34. package/dist/src/ngboost/ngboost.d.ts.map +1 -0
  35. package/dist/src/ngboost/ngboost.js +231 -0
  36. package/dist/src/ngboost/ngboost.js.map +1 -0
  37. package/dist/src/optimization/optimization.d.ts +700 -0
  38. package/dist/src/optimization/optimization.d.ts.map +1 -0
  39. package/dist/src/optimization/optimization.js +411 -0
  40. package/dist/src/optimization/optimization.js.map +1 -0
  41. package/dist/src/optuna/optuna.d.ts +857 -0
  42. package/dist/src/optuna/optuna.d.ts.map +1 -0
  43. package/dist/src/optuna/optuna.js +270 -0
  44. package/dist/src/optuna/optuna.js.map +1 -0
  45. package/dist/src/pymc/pymc.d.ts +2932 -0
  46. package/dist/src/pymc/pymc.d.ts.map +1 -0
  47. package/dist/src/pymc/pymc.js +688 -0
  48. package/dist/src/pymc/pymc.js.map +1 -0
  49. package/dist/src/scipy/scipy.d.ts +2205 -0
  50. package/dist/src/scipy/scipy.d.ts.map +1 -0
  51. package/dist/src/scipy/scipy.js +884 -0
  52. package/dist/src/scipy/scipy.js.map +1 -0
  53. package/dist/src/shap/shap.d.ts +4611 -0
  54. package/dist/src/shap/shap.d.ts.map +1 -0
  55. package/dist/src/shap/shap.js +552 -0
  56. package/dist/src/shap/shap.js.map +1 -0
  57. package/dist/src/simanneal/simanneal.d.ts +628 -0
  58. package/dist/src/simanneal/simanneal.d.ts.map +1 -0
  59. package/dist/src/simanneal/simanneal.js +328 -0
  60. package/dist/src/simanneal/simanneal.js.map +1 -0
  61. package/dist/src/simulation/simulation.d.ts +224 -0
  62. package/dist/src/simulation/simulation.d.ts.map +1 -0
  63. package/dist/src/simulation/simulation.js +189 -0
  64. package/dist/src/simulation/simulation.js.map +1 -0
  65. package/dist/src/sklearn/sklearn.d.ts +6362 -0
  66. package/dist/src/sklearn/sklearn.d.ts.map +1 -0
  67. package/dist/src/sklearn/sklearn.js +1508 -0
  68. package/dist/src/sklearn/sklearn.js.map +1 -0
  69. package/dist/src/torch/torch.d.ts +1205 -0
  70. package/dist/src/torch/torch.d.ts.map +1 -0
  71. package/dist/src/torch/torch.js +440 -0
  72. package/dist/src/torch/torch.js.map +1 -0
  73. package/dist/src/types.d.ts +43 -0
  74. package/dist/src/types.d.ts.map +1 -0
  75. package/dist/src/types.js +44 -0
  76. package/dist/src/types.js.map +1 -0
  77. package/dist/src/xgboost/xgboost.d.ts +1424 -0
  78. package/dist/src/xgboost/xgboost.d.ts.map +1 -0
  79. package/dist/src/xgboost/xgboost.js +432 -0
  80. package/dist/src/xgboost/xgboost.js.map +1 -0
  81. package/package.json +3 -3
@@ -0,0 +1,857 @@
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
+ * Bayesian optimization using Optuna's TPE sampler.
7
+ *
8
+ * Provides parameter optimization for blackbox functions with mixed parameter
9
+ * types (categorical, integer, continuous). Useful for:
10
+ * - Hyperparameter tuning for ML models
11
+ * - Design optimization
12
+ * - Any blackbox optimization with structured parameter spaces
13
+ *
14
+ * @packageDocumentation
15
+ */
16
+ import { StructType, VariantType, OptionType, ArrayType, IntegerType, FloatType, StringType, BooleanType, FunctionType, NullType } from "@elaraai/east";
17
+ /**
18
+ * Parameter value type (can be int, float, string, or bool).
19
+ */
20
+ export declare const ParamValueType: VariantType<{
21
+ readonly int: IntegerType;
22
+ readonly float: FloatType;
23
+ readonly string: StringType;
24
+ readonly bool: BooleanType;
25
+ }>;
26
+ /**
27
+ * Parameter space kind for defining search spaces.
28
+ */
29
+ export declare const ParamSpaceKindType: VariantType<{
30
+ /** Integer parameter with low/high bounds */
31
+ readonly int: NullType;
32
+ /** Float parameter with low/high bounds */
33
+ readonly float: NullType;
34
+ /** Categorical parameter with choices */
35
+ readonly categorical: NullType;
36
+ /** Log-uniform float parameter (for learning rates, etc.) */
37
+ readonly log_uniform: NullType;
38
+ }>;
39
+ /**
40
+ * Parameter search space definition.
41
+ *
42
+ * Defines a single parameter's name, type, and valid range/choices.
43
+ */
44
+ export declare const ParamSpaceType: StructType<{
45
+ /** Parameter name */
46
+ readonly name: StringType;
47
+ /** Parameter kind (int, float, categorical, log_uniform) */
48
+ readonly kind: VariantType<{
49
+ /** Integer parameter with low/high bounds */
50
+ readonly int: NullType;
51
+ /** Float parameter with low/high bounds */
52
+ readonly float: NullType;
53
+ /** Categorical parameter with choices */
54
+ readonly categorical: NullType;
55
+ /** Log-uniform float parameter (for learning rates, etc.) */
56
+ readonly log_uniform: NullType;
57
+ }>;
58
+ /** Lower bound (for int, float, log_uniform) */
59
+ readonly low: OptionType<FloatType>;
60
+ /** Upper bound (for int, float, log_uniform) */
61
+ readonly high: OptionType<FloatType>;
62
+ /** Choices (for categorical) */
63
+ readonly choices: OptionType<ArrayType<VariantType<{
64
+ readonly int: IntegerType;
65
+ readonly float: FloatType;
66
+ readonly string: StringType;
67
+ readonly bool: BooleanType;
68
+ }>>>;
69
+ }>;
70
+ /**
71
+ * Named parameter (name + value pair).
72
+ *
73
+ * Represents a single parameter with its suggested/best value.
74
+ */
75
+ export declare const NamedParamType: StructType<{
76
+ /** Parameter name */
77
+ readonly name: StringType;
78
+ /** Parameter value */
79
+ readonly value: VariantType<{
80
+ readonly int: IntegerType;
81
+ readonly float: FloatType;
82
+ readonly string: StringType;
83
+ readonly bool: BooleanType;
84
+ }>;
85
+ }>;
86
+ /**
87
+ * Optimization direction (minimize or maximize).
88
+ */
89
+ export declare const OptimizationDirectionType: VariantType<{
90
+ readonly minimize: NullType;
91
+ readonly maximize: NullType;
92
+ }>;
93
+ /**
94
+ * Pruner type for early stopping of unpromising trials.
95
+ */
96
+ export declare const PrunerType: VariantType<{
97
+ /** No pruning */
98
+ readonly none: NullType;
99
+ /** Median pruner - prune if below median of previous trials */
100
+ readonly median: NullType;
101
+ /** Hyperband pruner - aggressive early stopping */
102
+ readonly hyperband: NullType;
103
+ }>;
104
+ /**
105
+ * Optuna study configuration.
106
+ */
107
+ export declare const OptunaStudyConfigType: StructType<{
108
+ /** Optimization direction (default: minimize) */
109
+ readonly direction: OptionType<VariantType<{
110
+ readonly minimize: NullType;
111
+ readonly maximize: NullType;
112
+ }>>;
113
+ /** Number of trials to run */
114
+ readonly n_trials: IntegerType;
115
+ /** Random seed for reproducibility */
116
+ readonly random_state: OptionType<IntegerType>;
117
+ /** Pruner for early stopping (default: none) */
118
+ readonly pruner: OptionType<VariantType<{
119
+ /** No pruning */
120
+ readonly none: NullType;
121
+ /** Median pruner - prune if below median of previous trials */
122
+ readonly median: NullType;
123
+ /** Hyperband pruner - aggressive early stopping */
124
+ readonly hyperband: NullType;
125
+ }>>;
126
+ /** Initial parameters to evaluate before sampling (warm-start) */
127
+ readonly initial_params: OptionType<ArrayType<StructType<{
128
+ /** Parameter name */
129
+ readonly name: StringType;
130
+ /** Parameter value */
131
+ readonly value: VariantType<{
132
+ readonly int: IntegerType;
133
+ readonly float: FloatType;
134
+ readonly string: StringType;
135
+ readonly bool: BooleanType;
136
+ }>;
137
+ }>>>;
138
+ }>;
139
+ /**
140
+ * Single trial result.
141
+ */
142
+ export declare const TrialResultType: StructType<{
143
+ /** Trial ID */
144
+ readonly trial_id: IntegerType;
145
+ /** Parameters used in this trial */
146
+ readonly params: ArrayType<StructType<{
147
+ /** Parameter name */
148
+ readonly name: StringType;
149
+ /** Parameter value */
150
+ readonly value: VariantType<{
151
+ readonly int: IntegerType;
152
+ readonly float: FloatType;
153
+ readonly string: StringType;
154
+ readonly bool: BooleanType;
155
+ }>;
156
+ }>>;
157
+ /** Objective score */
158
+ readonly score: FloatType;
159
+ }>;
160
+ /**
161
+ * Optimization study result.
162
+ */
163
+ export declare const StudyResultType: StructType<{
164
+ /** Best parameters found */
165
+ readonly best_params: ArrayType<StructType<{
166
+ /** Parameter name */
167
+ readonly name: StringType;
168
+ /** Parameter value */
169
+ readonly value: VariantType<{
170
+ readonly int: IntegerType;
171
+ readonly float: FloatType;
172
+ readonly string: StringType;
173
+ readonly bool: BooleanType;
174
+ }>;
175
+ }>>;
176
+ /** Best objective score */
177
+ readonly best_score: FloatType;
178
+ /** All completed trials */
179
+ readonly trials: ArrayType<StructType<{
180
+ /** Trial ID */
181
+ readonly trial_id: IntegerType;
182
+ /** Parameters used in this trial */
183
+ readonly params: ArrayType<StructType<{
184
+ /** Parameter name */
185
+ readonly name: StringType;
186
+ /** Parameter value */
187
+ readonly value: VariantType<{
188
+ readonly int: IntegerType;
189
+ readonly float: FloatType;
190
+ readonly string: StringType;
191
+ readonly bool: BooleanType;
192
+ }>;
193
+ }>>;
194
+ /** Objective score */
195
+ readonly score: FloatType;
196
+ }>>;
197
+ }>;
198
+ /**
199
+ * Objective function type: takes named params, returns score.
200
+ *
201
+ * The objective function is an East function that receives suggested
202
+ * parameters and returns a scalar score to minimize/maximize.
203
+ */
204
+ export declare const ObjectiveFunctionType: FunctionType<[ArrayType<StructType<{
205
+ /** Parameter name */
206
+ readonly name: StringType;
207
+ /** Parameter value */
208
+ readonly value: VariantType<{
209
+ readonly int: IntegerType;
210
+ readonly float: FloatType;
211
+ readonly string: StringType;
212
+ readonly bool: BooleanType;
213
+ }>;
214
+ }>>], FloatType>;
215
+ /**
216
+ * Run Bayesian optimization with Optuna.
217
+ *
218
+ * Uses TPE (Tree-structured Parzen Estimator) to efficiently search
219
+ * the parameter space, balancing exploration and exploitation.
220
+ *
221
+ * @param search_space - Array of parameter space definitions
222
+ * @param objective - East function that takes params and returns score
223
+ * @param config - Study configuration (n_trials, direction, etc.)
224
+ * @returns Study result with best params, best score, and all trials
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * import { East, FloatType, variant } from "@elaraai/east";
229
+ * import { Optuna } from "@elaraai/east-py-datascience";
230
+ *
231
+ * // Define objective: minimize (x - 2)^2 + (y - 3)^2
232
+ * const objective = East.function(
233
+ * [ArrayType(Optuna.Types.NamedParamType)],
234
+ * FloatType,
235
+ * ($, params) => {
236
+ * // Extract params by name
237
+ * const x = $.let(params.get(0n).value); // First param
238
+ * const y = $.let(params.get(1n).value); // Second param
239
+ * // Compute objective (assuming float params)
240
+ * return $.return(
241
+ * x.match({ float: v => v }).subtract(2.0).multiply(
242
+ * x.match({ float: v => v }).subtract(2.0)
243
+ * ).add(
244
+ * y.match({ float: v => v }).subtract(3.0).multiply(
245
+ * y.match({ float: v => v }).subtract(3.0)
246
+ * )
247
+ * )
248
+ * );
249
+ * }
250
+ * );
251
+ *
252
+ * const optimize = East.function([], Optuna.Types.StudyResultType, $ => {
253
+ * const search_space = $.let([
254
+ * { name: "x", kind: variant("float", null), low: variant("some", 0.0), high: variant("some", 5.0), choices: variant("none", null) },
255
+ * { name: "y", kind: variant("float", null), low: variant("some", 0.0), high: variant("some", 5.0), choices: variant("none", null) },
256
+ * ]);
257
+ * const config = $.let({
258
+ * direction: variant("some", variant("minimize", null)),
259
+ * n_trials: 50n,
260
+ * random_state: variant("some", 42n),
261
+ * pruner: variant("none", null),
262
+ * });
263
+ * return $.return(Optuna.optimize(search_space, objective, config));
264
+ * });
265
+ * ```
266
+ */
267
+ export declare const optuna_optimize: import("@elaraai/east").PlatformDefinition<[ArrayType<StructType<{
268
+ /** Parameter name */
269
+ readonly name: StringType;
270
+ /** Parameter kind (int, float, categorical, log_uniform) */
271
+ readonly kind: VariantType<{
272
+ /** Integer parameter with low/high bounds */
273
+ readonly int: NullType;
274
+ /** Float parameter with low/high bounds */
275
+ readonly float: NullType;
276
+ /** Categorical parameter with choices */
277
+ readonly categorical: NullType;
278
+ /** Log-uniform float parameter (for learning rates, etc.) */
279
+ readonly log_uniform: NullType;
280
+ }>;
281
+ /** Lower bound (for int, float, log_uniform) */
282
+ readonly low: OptionType<FloatType>;
283
+ /** Upper bound (for int, float, log_uniform) */
284
+ readonly high: OptionType<FloatType>;
285
+ /** Choices (for categorical) */
286
+ readonly choices: OptionType<ArrayType<VariantType<{
287
+ readonly int: IntegerType;
288
+ readonly float: FloatType;
289
+ readonly string: StringType;
290
+ readonly bool: BooleanType;
291
+ }>>>;
292
+ }>>, FunctionType<[ArrayType<StructType<{
293
+ /** Parameter name */
294
+ readonly name: StringType;
295
+ /** Parameter value */
296
+ readonly value: VariantType<{
297
+ readonly int: IntegerType;
298
+ readonly float: FloatType;
299
+ readonly string: StringType;
300
+ readonly bool: BooleanType;
301
+ }>;
302
+ }>>], FloatType>, StructType<{
303
+ /** Optimization direction (default: minimize) */
304
+ readonly direction: OptionType<VariantType<{
305
+ readonly minimize: NullType;
306
+ readonly maximize: NullType;
307
+ }>>;
308
+ /** Number of trials to run */
309
+ readonly n_trials: IntegerType;
310
+ /** Random seed for reproducibility */
311
+ readonly random_state: OptionType<IntegerType>;
312
+ /** Pruner for early stopping (default: none) */
313
+ readonly pruner: OptionType<VariantType<{
314
+ /** No pruning */
315
+ readonly none: NullType;
316
+ /** Median pruner - prune if below median of previous trials */
317
+ readonly median: NullType;
318
+ /** Hyperband pruner - aggressive early stopping */
319
+ readonly hyperband: NullType;
320
+ }>>;
321
+ /** Initial parameters to evaluate before sampling (warm-start) */
322
+ readonly initial_params: OptionType<ArrayType<StructType<{
323
+ /** Parameter name */
324
+ readonly name: StringType;
325
+ /** Parameter value */
326
+ readonly value: VariantType<{
327
+ readonly int: IntegerType;
328
+ readonly float: FloatType;
329
+ readonly string: StringType;
330
+ readonly bool: BooleanType;
331
+ }>;
332
+ }>>>;
333
+ }>], StructType<{
334
+ /** Best parameters found */
335
+ readonly best_params: ArrayType<StructType<{
336
+ /** Parameter name */
337
+ readonly name: StringType;
338
+ /** Parameter value */
339
+ readonly value: VariantType<{
340
+ readonly int: IntegerType;
341
+ readonly float: FloatType;
342
+ readonly string: StringType;
343
+ readonly bool: BooleanType;
344
+ }>;
345
+ }>>;
346
+ /** Best objective score */
347
+ readonly best_score: FloatType;
348
+ /** All completed trials */
349
+ readonly trials: ArrayType<StructType<{
350
+ /** Trial ID */
351
+ readonly trial_id: IntegerType;
352
+ /** Parameters used in this trial */
353
+ readonly params: ArrayType<StructType<{
354
+ /** Parameter name */
355
+ readonly name: StringType;
356
+ /** Parameter value */
357
+ readonly value: VariantType<{
358
+ readonly int: IntegerType;
359
+ readonly float: FloatType;
360
+ readonly string: StringType;
361
+ readonly bool: BooleanType;
362
+ }>;
363
+ }>>;
364
+ /** Objective score */
365
+ readonly score: FloatType;
366
+ }>>;
367
+ }>>;
368
+ /**
369
+ * Type definitions for Optuna optimization.
370
+ */
371
+ export declare const OptunaTypes: {
372
+ /** Parameter value variant type */
373
+ readonly ParamValueType: VariantType<{
374
+ readonly int: IntegerType;
375
+ readonly float: FloatType;
376
+ readonly string: StringType;
377
+ readonly bool: BooleanType;
378
+ }>;
379
+ /** Parameter space kind type */
380
+ readonly ParamSpaceKindType: VariantType<{
381
+ /** Integer parameter with low/high bounds */
382
+ readonly int: NullType;
383
+ /** Float parameter with low/high bounds */
384
+ readonly float: NullType;
385
+ /** Categorical parameter with choices */
386
+ readonly categorical: NullType;
387
+ /** Log-uniform float parameter (for learning rates, etc.) */
388
+ readonly log_uniform: NullType;
389
+ }>;
390
+ /** Parameter space definition type */
391
+ readonly ParamSpaceType: StructType<{
392
+ /** Parameter name */
393
+ readonly name: StringType;
394
+ /** Parameter kind (int, float, categorical, log_uniform) */
395
+ readonly kind: VariantType<{
396
+ /** Integer parameter with low/high bounds */
397
+ readonly int: NullType;
398
+ /** Float parameter with low/high bounds */
399
+ readonly float: NullType;
400
+ /** Categorical parameter with choices */
401
+ readonly categorical: NullType;
402
+ /** Log-uniform float parameter (for learning rates, etc.) */
403
+ readonly log_uniform: NullType;
404
+ }>;
405
+ /** Lower bound (for int, float, log_uniform) */
406
+ readonly low: OptionType<FloatType>;
407
+ /** Upper bound (for int, float, log_uniform) */
408
+ readonly high: OptionType<FloatType>;
409
+ /** Choices (for categorical) */
410
+ readonly choices: OptionType<ArrayType<VariantType<{
411
+ readonly int: IntegerType;
412
+ readonly float: FloatType;
413
+ readonly string: StringType;
414
+ readonly bool: BooleanType;
415
+ }>>>;
416
+ }>;
417
+ /** Named parameter type */
418
+ readonly NamedParamType: StructType<{
419
+ /** Parameter name */
420
+ readonly name: StringType;
421
+ /** Parameter value */
422
+ readonly value: VariantType<{
423
+ readonly int: IntegerType;
424
+ readonly float: FloatType;
425
+ readonly string: StringType;
426
+ readonly bool: BooleanType;
427
+ }>;
428
+ }>;
429
+ /** Optimization direction type */
430
+ readonly OptimizationDirectionType: VariantType<{
431
+ readonly minimize: NullType;
432
+ readonly maximize: NullType;
433
+ }>;
434
+ /** Pruner type */
435
+ readonly PrunerType: VariantType<{
436
+ /** No pruning */
437
+ readonly none: NullType;
438
+ /** Median pruner - prune if below median of previous trials */
439
+ readonly median: NullType;
440
+ /** Hyperband pruner - aggressive early stopping */
441
+ readonly hyperband: NullType;
442
+ }>;
443
+ /** Study config type */
444
+ readonly StudyConfigType: StructType<{
445
+ /** Optimization direction (default: minimize) */
446
+ readonly direction: OptionType<VariantType<{
447
+ readonly minimize: NullType;
448
+ readonly maximize: NullType;
449
+ }>>;
450
+ /** Number of trials to run */
451
+ readonly n_trials: IntegerType;
452
+ /** Random seed for reproducibility */
453
+ readonly random_state: OptionType<IntegerType>;
454
+ /** Pruner for early stopping (default: none) */
455
+ readonly pruner: OptionType<VariantType<{
456
+ /** No pruning */
457
+ readonly none: NullType;
458
+ /** Median pruner - prune if below median of previous trials */
459
+ readonly median: NullType;
460
+ /** Hyperband pruner - aggressive early stopping */
461
+ readonly hyperband: NullType;
462
+ }>>;
463
+ /** Initial parameters to evaluate before sampling (warm-start) */
464
+ readonly initial_params: OptionType<ArrayType<StructType<{
465
+ /** Parameter name */
466
+ readonly name: StringType;
467
+ /** Parameter value */
468
+ readonly value: VariantType<{
469
+ readonly int: IntegerType;
470
+ readonly float: FloatType;
471
+ readonly string: StringType;
472
+ readonly bool: BooleanType;
473
+ }>;
474
+ }>>>;
475
+ }>;
476
+ /** Trial result type */
477
+ readonly TrialResultType: StructType<{
478
+ /** Trial ID */
479
+ readonly trial_id: IntegerType;
480
+ /** Parameters used in this trial */
481
+ readonly params: ArrayType<StructType<{
482
+ /** Parameter name */
483
+ readonly name: StringType;
484
+ /** Parameter value */
485
+ readonly value: VariantType<{
486
+ readonly int: IntegerType;
487
+ readonly float: FloatType;
488
+ readonly string: StringType;
489
+ readonly bool: BooleanType;
490
+ }>;
491
+ }>>;
492
+ /** Objective score */
493
+ readonly score: FloatType;
494
+ }>;
495
+ /** Study result type */
496
+ readonly StudyResultType: StructType<{
497
+ /** Best parameters found */
498
+ readonly best_params: ArrayType<StructType<{
499
+ /** Parameter name */
500
+ readonly name: StringType;
501
+ /** Parameter value */
502
+ readonly value: VariantType<{
503
+ readonly int: IntegerType;
504
+ readonly float: FloatType;
505
+ readonly string: StringType;
506
+ readonly bool: BooleanType;
507
+ }>;
508
+ }>>;
509
+ /** Best objective score */
510
+ readonly best_score: FloatType;
511
+ /** All completed trials */
512
+ readonly trials: ArrayType<StructType<{
513
+ /** Trial ID */
514
+ readonly trial_id: IntegerType;
515
+ /** Parameters used in this trial */
516
+ readonly params: ArrayType<StructType<{
517
+ /** Parameter name */
518
+ readonly name: StringType;
519
+ /** Parameter value */
520
+ readonly value: VariantType<{
521
+ readonly int: IntegerType;
522
+ readonly float: FloatType;
523
+ readonly string: StringType;
524
+ readonly bool: BooleanType;
525
+ }>;
526
+ }>>;
527
+ /** Objective score */
528
+ readonly score: FloatType;
529
+ }>>;
530
+ }>;
531
+ /** Objective function type */
532
+ readonly ObjectiveFunctionType: FunctionType<[ArrayType<StructType<{
533
+ /** Parameter name */
534
+ readonly name: StringType;
535
+ /** Parameter value */
536
+ readonly value: VariantType<{
537
+ readonly int: IntegerType;
538
+ readonly float: FloatType;
539
+ readonly string: StringType;
540
+ readonly bool: BooleanType;
541
+ }>;
542
+ }>>], FloatType>;
543
+ };
544
+ /**
545
+ * Bayesian optimization using Optuna.
546
+ *
547
+ * Provides efficient parameter optimization using TPE (Tree-structured
548
+ * Parzen Estimator) for blackbox functions with mixed parameter types.
549
+ *
550
+ * Supports:
551
+ * - Integer, float, and categorical parameters
552
+ * - Log-uniform sampling for learning rates
553
+ * - Minimization and maximization
554
+ * - Early stopping with pruners
555
+ *
556
+ * @example
557
+ * ```ts
558
+ * import { East, FloatType, variant } from "@elaraai/east";
559
+ * import { Optuna } from "@elaraai/east-py-datascience";
560
+ *
561
+ * const objective = East.function(
562
+ * [ArrayType(Optuna.Types.NamedParamType)],
563
+ * FloatType,
564
+ * ($, params) => {
565
+ * // Your objective function here
566
+ * return $.return(score);
567
+ * }
568
+ * );
569
+ *
570
+ * const result = Optuna.optimize(search_space, objective, config);
571
+ * ```
572
+ */
573
+ export declare const Optuna: {
574
+ /**
575
+ * Run Bayesian optimization.
576
+ *
577
+ * Efficiently searches the parameter space using TPE.
578
+ */
579
+ readonly optimize: import("@elaraai/east").PlatformDefinition<[ArrayType<StructType<{
580
+ /** Parameter name */
581
+ readonly name: StringType;
582
+ /** Parameter kind (int, float, categorical, log_uniform) */
583
+ readonly kind: VariantType<{
584
+ /** Integer parameter with low/high bounds */
585
+ readonly int: NullType;
586
+ /** Float parameter with low/high bounds */
587
+ readonly float: NullType;
588
+ /** Categorical parameter with choices */
589
+ readonly categorical: NullType;
590
+ /** Log-uniform float parameter (for learning rates, etc.) */
591
+ readonly log_uniform: NullType;
592
+ }>;
593
+ /** Lower bound (for int, float, log_uniform) */
594
+ readonly low: OptionType<FloatType>;
595
+ /** Upper bound (for int, float, log_uniform) */
596
+ readonly high: OptionType<FloatType>;
597
+ /** Choices (for categorical) */
598
+ readonly choices: OptionType<ArrayType<VariantType<{
599
+ readonly int: IntegerType;
600
+ readonly float: FloatType;
601
+ readonly string: StringType;
602
+ readonly bool: BooleanType;
603
+ }>>>;
604
+ }>>, FunctionType<[ArrayType<StructType<{
605
+ /** Parameter name */
606
+ readonly name: StringType;
607
+ /** Parameter value */
608
+ readonly value: VariantType<{
609
+ readonly int: IntegerType;
610
+ readonly float: FloatType;
611
+ readonly string: StringType;
612
+ readonly bool: BooleanType;
613
+ }>;
614
+ }>>], FloatType>, StructType<{
615
+ /** Optimization direction (default: minimize) */
616
+ readonly direction: OptionType<VariantType<{
617
+ readonly minimize: NullType;
618
+ readonly maximize: NullType;
619
+ }>>;
620
+ /** Number of trials to run */
621
+ readonly n_trials: IntegerType;
622
+ /** Random seed for reproducibility */
623
+ readonly random_state: OptionType<IntegerType>;
624
+ /** Pruner for early stopping (default: none) */
625
+ readonly pruner: OptionType<VariantType<{
626
+ /** No pruning */
627
+ readonly none: NullType;
628
+ /** Median pruner - prune if below median of previous trials */
629
+ readonly median: NullType;
630
+ /** Hyperband pruner - aggressive early stopping */
631
+ readonly hyperband: NullType;
632
+ }>>;
633
+ /** Initial parameters to evaluate before sampling (warm-start) */
634
+ readonly initial_params: OptionType<ArrayType<StructType<{
635
+ /** Parameter name */
636
+ readonly name: StringType;
637
+ /** Parameter value */
638
+ readonly value: VariantType<{
639
+ readonly int: IntegerType;
640
+ readonly float: FloatType;
641
+ readonly string: StringType;
642
+ readonly bool: BooleanType;
643
+ }>;
644
+ }>>>;
645
+ }>], StructType<{
646
+ /** Best parameters found */
647
+ readonly best_params: ArrayType<StructType<{
648
+ /** Parameter name */
649
+ readonly name: StringType;
650
+ /** Parameter value */
651
+ readonly value: VariantType<{
652
+ readonly int: IntegerType;
653
+ readonly float: FloatType;
654
+ readonly string: StringType;
655
+ readonly bool: BooleanType;
656
+ }>;
657
+ }>>;
658
+ /** Best objective score */
659
+ readonly best_score: FloatType;
660
+ /** All completed trials */
661
+ readonly trials: ArrayType<StructType<{
662
+ /** Trial ID */
663
+ readonly trial_id: IntegerType;
664
+ /** Parameters used in this trial */
665
+ readonly params: ArrayType<StructType<{
666
+ /** Parameter name */
667
+ readonly name: StringType;
668
+ /** Parameter value */
669
+ readonly value: VariantType<{
670
+ readonly int: IntegerType;
671
+ readonly float: FloatType;
672
+ readonly string: StringType;
673
+ readonly bool: BooleanType;
674
+ }>;
675
+ }>>;
676
+ /** Objective score */
677
+ readonly score: FloatType;
678
+ }>>;
679
+ }>>;
680
+ /**
681
+ * Type definitions for Optuna functions.
682
+ */
683
+ readonly Types: {
684
+ /** Parameter value variant type */
685
+ readonly ParamValueType: VariantType<{
686
+ readonly int: IntegerType;
687
+ readonly float: FloatType;
688
+ readonly string: StringType;
689
+ readonly bool: BooleanType;
690
+ }>;
691
+ /** Parameter space kind type */
692
+ readonly ParamSpaceKindType: VariantType<{
693
+ /** Integer parameter with low/high bounds */
694
+ readonly int: NullType;
695
+ /** Float parameter with low/high bounds */
696
+ readonly float: NullType;
697
+ /** Categorical parameter with choices */
698
+ readonly categorical: NullType;
699
+ /** Log-uniform float parameter (for learning rates, etc.) */
700
+ readonly log_uniform: NullType;
701
+ }>;
702
+ /** Parameter space definition type */
703
+ readonly ParamSpaceType: StructType<{
704
+ /** Parameter name */
705
+ readonly name: StringType;
706
+ /** Parameter kind (int, float, categorical, log_uniform) */
707
+ readonly kind: VariantType<{
708
+ /** Integer parameter with low/high bounds */
709
+ readonly int: NullType;
710
+ /** Float parameter with low/high bounds */
711
+ readonly float: NullType;
712
+ /** Categorical parameter with choices */
713
+ readonly categorical: NullType;
714
+ /** Log-uniform float parameter (for learning rates, etc.) */
715
+ readonly log_uniform: NullType;
716
+ }>;
717
+ /** Lower bound (for int, float, log_uniform) */
718
+ readonly low: OptionType<FloatType>;
719
+ /** Upper bound (for int, float, log_uniform) */
720
+ readonly high: OptionType<FloatType>;
721
+ /** Choices (for categorical) */
722
+ readonly choices: OptionType<ArrayType<VariantType<{
723
+ readonly int: IntegerType;
724
+ readonly float: FloatType;
725
+ readonly string: StringType;
726
+ readonly bool: BooleanType;
727
+ }>>>;
728
+ }>;
729
+ /** Named parameter type */
730
+ readonly NamedParamType: StructType<{
731
+ /** Parameter name */
732
+ readonly name: StringType;
733
+ /** Parameter value */
734
+ readonly value: VariantType<{
735
+ readonly int: IntegerType;
736
+ readonly float: FloatType;
737
+ readonly string: StringType;
738
+ readonly bool: BooleanType;
739
+ }>;
740
+ }>;
741
+ /** Optimization direction type */
742
+ readonly OptimizationDirectionType: VariantType<{
743
+ readonly minimize: NullType;
744
+ readonly maximize: NullType;
745
+ }>;
746
+ /** Pruner type */
747
+ readonly PrunerType: VariantType<{
748
+ /** No pruning */
749
+ readonly none: NullType;
750
+ /** Median pruner - prune if below median of previous trials */
751
+ readonly median: NullType;
752
+ /** Hyperband pruner - aggressive early stopping */
753
+ readonly hyperband: NullType;
754
+ }>;
755
+ /** Study config type */
756
+ readonly StudyConfigType: StructType<{
757
+ /** Optimization direction (default: minimize) */
758
+ readonly direction: OptionType<VariantType<{
759
+ readonly minimize: NullType;
760
+ readonly maximize: NullType;
761
+ }>>;
762
+ /** Number of trials to run */
763
+ readonly n_trials: IntegerType;
764
+ /** Random seed for reproducibility */
765
+ readonly random_state: OptionType<IntegerType>;
766
+ /** Pruner for early stopping (default: none) */
767
+ readonly pruner: OptionType<VariantType<{
768
+ /** No pruning */
769
+ readonly none: NullType;
770
+ /** Median pruner - prune if below median of previous trials */
771
+ readonly median: NullType;
772
+ /** Hyperband pruner - aggressive early stopping */
773
+ readonly hyperband: NullType;
774
+ }>>;
775
+ /** Initial parameters to evaluate before sampling (warm-start) */
776
+ readonly initial_params: OptionType<ArrayType<StructType<{
777
+ /** Parameter name */
778
+ readonly name: StringType;
779
+ /** Parameter value */
780
+ readonly value: VariantType<{
781
+ readonly int: IntegerType;
782
+ readonly float: FloatType;
783
+ readonly string: StringType;
784
+ readonly bool: BooleanType;
785
+ }>;
786
+ }>>>;
787
+ }>;
788
+ /** Trial result type */
789
+ readonly TrialResultType: StructType<{
790
+ /** Trial ID */
791
+ readonly trial_id: IntegerType;
792
+ /** Parameters used in this trial */
793
+ readonly params: ArrayType<StructType<{
794
+ /** Parameter name */
795
+ readonly name: StringType;
796
+ /** Parameter value */
797
+ readonly value: VariantType<{
798
+ readonly int: IntegerType;
799
+ readonly float: FloatType;
800
+ readonly string: StringType;
801
+ readonly bool: BooleanType;
802
+ }>;
803
+ }>>;
804
+ /** Objective score */
805
+ readonly score: FloatType;
806
+ }>;
807
+ /** Study result type */
808
+ readonly StudyResultType: StructType<{
809
+ /** Best parameters found */
810
+ readonly best_params: ArrayType<StructType<{
811
+ /** Parameter name */
812
+ readonly name: StringType;
813
+ /** Parameter value */
814
+ readonly value: VariantType<{
815
+ readonly int: IntegerType;
816
+ readonly float: FloatType;
817
+ readonly string: StringType;
818
+ readonly bool: BooleanType;
819
+ }>;
820
+ }>>;
821
+ /** Best objective score */
822
+ readonly best_score: FloatType;
823
+ /** All completed trials */
824
+ readonly trials: ArrayType<StructType<{
825
+ /** Trial ID */
826
+ readonly trial_id: IntegerType;
827
+ /** Parameters used in this trial */
828
+ readonly params: ArrayType<StructType<{
829
+ /** Parameter name */
830
+ readonly name: StringType;
831
+ /** Parameter value */
832
+ readonly value: VariantType<{
833
+ readonly int: IntegerType;
834
+ readonly float: FloatType;
835
+ readonly string: StringType;
836
+ readonly bool: BooleanType;
837
+ }>;
838
+ }>>;
839
+ /** Objective score */
840
+ readonly score: FloatType;
841
+ }>>;
842
+ }>;
843
+ /** Objective function type */
844
+ readonly ObjectiveFunctionType: FunctionType<[ArrayType<StructType<{
845
+ /** Parameter name */
846
+ readonly name: StringType;
847
+ /** Parameter value */
848
+ readonly value: VariantType<{
849
+ readonly int: IntegerType;
850
+ readonly float: FloatType;
851
+ readonly string: StringType;
852
+ readonly bool: BooleanType;
853
+ }>;
854
+ }>>], FloatType>;
855
+ };
856
+ };
857
+ //# sourceMappingURL=optuna.d.ts.map