@elaraai/east-py-datascience 0.0.2-beta.1

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