@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.
Files changed (123) hide show
  1. package/README.md +58 -1
  2. package/dist/src/alns/alns.d.ts +528 -0
  3. package/dist/src/alns/alns.d.ts.map +1 -0
  4. package/dist/src/alns/alns.js +238 -0
  5. package/dist/src/alns/alns.js.map +1 -0
  6. package/dist/src/google_or/google_or.d.ts +2422 -0
  7. package/dist/src/google_or/google_or.d.ts.map +1 -0
  8. package/dist/src/google_or/google_or.js +542 -0
  9. package/dist/src/google_or/google_or.js.map +1 -0
  10. package/dist/{gp → src/gp}/gp.d.ts +185 -136
  11. package/dist/src/gp/gp.d.ts.map +1 -0
  12. package/dist/{gp → src/gp}/gp.js +64 -12
  13. package/dist/src/gp/gp.js.map +1 -0
  14. package/dist/src/index.d.ts +34 -0
  15. package/dist/src/index.d.ts.map +1 -0
  16. package/dist/src/index.js +57 -0
  17. package/dist/src/index.js.map +1 -0
  18. package/dist/src/lightgbm/lightgbm.d.ts +575 -0
  19. package/dist/src/lightgbm/lightgbm.d.ts.map +1 -0
  20. package/dist/{lightgbm → src/lightgbm}/lightgbm.js +104 -18
  21. package/dist/src/lightgbm/lightgbm.js.map +1 -0
  22. package/dist/src/lightning/lightning.d.ts +1594 -0
  23. package/dist/src/lightning/lightning.d.ts.map +1 -0
  24. package/dist/src/lightning/lightning.js +468 -0
  25. package/dist/src/lightning/lightning.js.map +1 -0
  26. package/dist/{mads → src/mads}/mads.d.ts +109 -112
  27. package/dist/src/mads/mads.d.ts.map +1 -0
  28. package/dist/{mads → src/mads}/mads.js +6 -8
  29. package/dist/src/mads/mads.js.map +1 -0
  30. package/dist/src/mapie/mapie.d.ts +3680 -0
  31. package/dist/src/mapie/mapie.d.ts.map +1 -0
  32. package/dist/src/mapie/mapie.js +616 -0
  33. package/dist/src/mapie/mapie.js.map +1 -0
  34. package/dist/{ngboost → src/ngboost}/ngboost.d.ts +192 -142
  35. package/dist/src/ngboost/ngboost.d.ts.map +1 -0
  36. package/dist/{ngboost → src/ngboost}/ngboost.js +67 -14
  37. package/dist/src/ngboost/ngboost.js.map +1 -0
  38. package/dist/src/optimization/optimization.d.ts +420 -0
  39. package/dist/src/optimization/optimization.d.ts.map +1 -0
  40. package/dist/src/optimization/optimization.js +257 -0
  41. package/dist/src/optimization/optimization.js.map +1 -0
  42. package/dist/{optuna → src/optuna}/optuna.d.ts +374 -314
  43. package/dist/src/optuna/optuna.d.ts.map +1 -0
  44. package/dist/{optuna → src/optuna}/optuna.js +2 -0
  45. package/dist/src/optuna/optuna.js.map +1 -0
  46. package/dist/src/pymc/pymc.d.ts +2932 -0
  47. package/dist/src/pymc/pymc.d.ts.map +1 -0
  48. package/dist/src/pymc/pymc.js +688 -0
  49. package/dist/src/pymc/pymc.js.map +1 -0
  50. package/dist/src/scipy/scipy.d.ts +2205 -0
  51. package/dist/src/scipy/scipy.d.ts.map +1 -0
  52. package/dist/src/scipy/scipy.js +884 -0
  53. package/dist/src/scipy/scipy.js.map +1 -0
  54. package/dist/src/shap/shap.d.ts +2988 -0
  55. package/dist/src/shap/shap.d.ts.map +1 -0
  56. package/dist/src/shap/shap.js +500 -0
  57. package/dist/src/shap/shap.js.map +1 -0
  58. package/dist/{simanneal → src/simanneal}/simanneal.d.ts +257 -160
  59. package/dist/src/simanneal/simanneal.d.ts.map +1 -0
  60. package/dist/{simanneal → src/simanneal}/simanneal.js +105 -8
  61. package/dist/src/simanneal/simanneal.js.map +1 -0
  62. package/dist/src/simulation/simulation.d.ts +431 -0
  63. package/dist/src/simulation/simulation.d.ts.map +1 -0
  64. package/dist/src/simulation/simulation.js +306 -0
  65. package/dist/src/simulation/simulation.js.map +1 -0
  66. package/dist/src/sklearn/sklearn.d.ts +6362 -0
  67. package/dist/src/sklearn/sklearn.d.ts.map +1 -0
  68. package/dist/src/sklearn/sklearn.js +1508 -0
  69. package/dist/src/sklearn/sklearn.js.map +1 -0
  70. package/dist/src/torch/torch.d.ts +1205 -0
  71. package/dist/src/torch/torch.d.ts.map +1 -0
  72. package/dist/{torch → src/torch}/torch.js +109 -18
  73. package/dist/src/torch/torch.js.map +1 -0
  74. package/dist/src/types.d.ts +43 -0
  75. package/dist/src/types.d.ts.map +1 -0
  76. package/dist/src/types.js +44 -0
  77. package/dist/src/types.js.map +1 -0
  78. package/dist/src/xgboost/xgboost.d.ts +1424 -0
  79. package/dist/src/xgboost/xgboost.d.ts.map +1 -0
  80. package/dist/src/xgboost/xgboost.js +432 -0
  81. package/dist/src/xgboost/xgboost.js.map +1 -0
  82. package/package.json +12 -12
  83. package/dist/gp/gp.d.ts.map +0 -1
  84. package/dist/gp/gp.js.map +0 -1
  85. package/dist/index.d.ts +0 -27
  86. package/dist/index.d.ts.map +0 -1
  87. package/dist/index.js +0 -41
  88. package/dist/index.js.map +0 -1
  89. package/dist/lightgbm/lightgbm.d.ts +0 -494
  90. package/dist/lightgbm/lightgbm.d.ts.map +0 -1
  91. package/dist/lightgbm/lightgbm.js.map +0 -1
  92. package/dist/mads/mads.d.ts.map +0 -1
  93. package/dist/mads/mads.js.map +0 -1
  94. package/dist/ngboost/ngboost.d.ts.map +0 -1
  95. package/dist/ngboost/ngboost.js.map +0 -1
  96. package/dist/optuna/optuna.d.ts.map +0 -1
  97. package/dist/optuna/optuna.js.map +0 -1
  98. package/dist/scipy/scipy.d.ts +0 -1260
  99. package/dist/scipy/scipy.d.ts.map +0 -1
  100. package/dist/scipy/scipy.js +0 -413
  101. package/dist/scipy/scipy.js.map +0 -1
  102. package/dist/shap/shap.d.ts +0 -657
  103. package/dist/shap/shap.d.ts.map +0 -1
  104. package/dist/shap/shap.js +0 -241
  105. package/dist/shap/shap.js.map +0 -1
  106. package/dist/simanneal/simanneal.d.ts.map +0 -1
  107. package/dist/simanneal/simanneal.js.map +0 -1
  108. package/dist/sklearn/sklearn.d.ts +0 -2691
  109. package/dist/sklearn/sklearn.d.ts.map +0 -1
  110. package/dist/sklearn/sklearn.js +0 -524
  111. package/dist/sklearn/sklearn.js.map +0 -1
  112. package/dist/torch/torch.d.ts +0 -1081
  113. package/dist/torch/torch.d.ts.map +0 -1
  114. package/dist/torch/torch.js.map +0 -1
  115. package/dist/tsconfig.tsbuildinfo +0 -1
  116. package/dist/types.d.ts +0 -80
  117. package/dist/types.d.ts.map +0 -1
  118. package/dist/types.js +0 -81
  119. package/dist/types.js.map +0 -1
  120. package/dist/xgboost/xgboost.d.ts +0 -504
  121. package/dist/xgboost/xgboost.d.ts.map +0 -1
  122. package/dist/xgboost/xgboost.js +0 -177
  123. package/dist/xgboost/xgboost.js.map +0 -1
@@ -0,0 +1,1424 @@
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
+ * XGBoost platform functions for East.
7
+ *
8
+ * Provides gradient boosting for regression and classification.
9
+ * Uses ONNX for model serialization to enable portable inference.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ import { StructType, VariantType, OptionType, IntegerType, FloatType, BlobType } from "@elaraai/east";
14
+ import { VectorType, MatrixType } from "../types.js";
15
+ export { VectorType, MatrixType } from "../types.js";
16
+ /**
17
+ * Configuration for XGBoost models.
18
+ */
19
+ export declare const XGBoostConfigType: StructType<{
20
+ /** Number of boosting rounds (default 100) */
21
+ readonly n_estimators: OptionType<IntegerType>;
22
+ /** Maximum tree depth (default 6) */
23
+ readonly max_depth: OptionType<IntegerType>;
24
+ /** Learning rate / step size shrinkage (default 0.3) */
25
+ readonly learning_rate: OptionType<FloatType>;
26
+ /** Minimum sum of instance weight needed in a child (default 1) */
27
+ readonly min_child_weight: OptionType<IntegerType>;
28
+ /** Subsample ratio of training instances (default 1.0) */
29
+ readonly subsample: OptionType<FloatType>;
30
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
31
+ readonly colsample_bytree: OptionType<FloatType>;
32
+ /** L1 regularization term (default 0) */
33
+ readonly reg_alpha: OptionType<FloatType>;
34
+ /** L2 regularization term (default 1) */
35
+ readonly reg_lambda: OptionType<FloatType>;
36
+ /** Minimum loss reduction required to make a further partition (default 0) */
37
+ readonly gamma: OptionType<FloatType>;
38
+ /** Random seed for reproducibility */
39
+ readonly random_state: OptionType<IntegerType>;
40
+ /** Number of parallel threads (default -1 for all cores) */
41
+ readonly n_jobs: OptionType<IntegerType>;
42
+ /** Sample weights for training (one per sample, default uniform) */
43
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
44
+ /** Column indices that contain categorical features (0-indexed) */
45
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
46
+ /** Number of categories per categorical feature (one per entry in categorical_features).
47
+ * Used to set explicit pandas Categorical range at both train and predict time,
48
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
49
+ * time, which XGBoost handles natively via learned default branch directions. */
50
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
51
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
52
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
53
+ /** Max categories considered per split for partition-based method (default 64). */
54
+ readonly max_cat_threshold: OptionType<IntegerType>;
55
+ }>;
56
+ /**
57
+ * Configuration for XGBoost quantile regression.
58
+ * Trains separate models for each quantile.
59
+ */
60
+ export declare const XGBoostQuantileConfigType: StructType<{
61
+ /** Quantiles to predict (e.g., [0.1, 0.5, 0.9] for 80% interval + median) */
62
+ readonly quantiles: VectorType<FloatType>;
63
+ /** Number of boosting rounds (default 100) */
64
+ readonly n_estimators: OptionType<IntegerType>;
65
+ /** Maximum tree depth (default 6) */
66
+ readonly max_depth: OptionType<IntegerType>;
67
+ /** Learning rate / step size shrinkage (default 0.3) */
68
+ readonly learning_rate: OptionType<FloatType>;
69
+ /** Minimum sum of instance weight needed in a child (default 1) */
70
+ readonly min_child_weight: OptionType<IntegerType>;
71
+ /** Subsample ratio of training instances (default 1.0) */
72
+ readonly subsample: OptionType<FloatType>;
73
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
74
+ readonly colsample_bytree: OptionType<FloatType>;
75
+ /** L1 regularization term (default 0) */
76
+ readonly reg_alpha: OptionType<FloatType>;
77
+ /** L2 regularization term (default 1) */
78
+ readonly reg_lambda: OptionType<FloatType>;
79
+ /** Minimum loss reduction required to make a further partition (default 0) */
80
+ readonly gamma: OptionType<FloatType>;
81
+ /** Random seed for reproducibility */
82
+ readonly random_state: OptionType<IntegerType>;
83
+ /** Number of parallel threads (default -1 for all cores) */
84
+ readonly n_jobs: OptionType<IntegerType>;
85
+ /** Sample weights for training (one per sample, default uniform) */
86
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
87
+ /** Column indices that contain categorical features (0-indexed) */
88
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
89
+ /** Number of categories per categorical feature (one per entry in categorical_features).
90
+ * Used to set explicit pandas Categorical range at both train and predict time,
91
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
92
+ * time, which XGBoost handles natively via learned default branch directions. */
93
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
94
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
95
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
96
+ /** Max categories considered per split for partition-based method (default 64). */
97
+ readonly max_cat_threshold: OptionType<IntegerType>;
98
+ }>;
99
+ /**
100
+ * Model blob type for serialized XGBoost models.
101
+ *
102
+ * Each model type has its own variant case containing cloudpickle bytes and metadata.
103
+ */
104
+ export declare const XGBoostModelBlobType: VariantType<{
105
+ /** XGBoost regressor model */
106
+ readonly xgboost_regressor: StructType<{
107
+ /** Cloudpickle serialized model */
108
+ readonly data: BlobType;
109
+ /** Number of input features */
110
+ readonly n_features: IntegerType;
111
+ /** Column indices of categorical features (for prediction) */
112
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
113
+ /** Number of categories per categorical feature (for consistent category space) */
114
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
115
+ }>;
116
+ /** XGBoost classifier model */
117
+ readonly xgboost_classifier: StructType<{
118
+ /** Cloudpickle serialized model */
119
+ readonly data: BlobType;
120
+ /** Number of input features */
121
+ readonly n_features: IntegerType;
122
+ /** Number of classes */
123
+ readonly n_classes: IntegerType;
124
+ /** Column indices of categorical features (for prediction) */
125
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
126
+ /** Number of categories per categorical feature (for consistent category space) */
127
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
128
+ }>;
129
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
130
+ readonly xgboost_quantile: StructType<{
131
+ /** Cloudpickle serialized dict of {quantile: model} */
132
+ readonly data: BlobType;
133
+ /** Quantiles this model predicts */
134
+ readonly quantiles: VectorType<FloatType>;
135
+ /** Number of input features */
136
+ readonly n_features: IntegerType;
137
+ /** Column indices of categorical features (for prediction) */
138
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
139
+ /** Number of categories per categorical feature (for consistent category space) */
140
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
141
+ }>;
142
+ }>;
143
+ /**
144
+ * Result from XGBoost quantile prediction.
145
+ */
146
+ export declare const XGBoostQuantilePredictResultType: StructType<{
147
+ /** Quantile values that were predicted */
148
+ readonly quantiles: VectorType<FloatType>;
149
+ /** Predictions matrix: (n_samples x n_quantiles) */
150
+ readonly predictions: MatrixType<FloatType>;
151
+ }>;
152
+ /**
153
+ * Train an XGBoost regression model.
154
+ *
155
+ * @param X - Feature matrix
156
+ * @param y - Target vector
157
+ * @param config - XGBoost configuration
158
+ * @returns Model blob containing trained regressor
159
+ */
160
+ export declare const xgboost_train_regressor: import("@elaraai/east").PlatformDefinition<[MatrixType<FloatType>, VectorType<FloatType>, StructType<{
161
+ /** Number of boosting rounds (default 100) */
162
+ readonly n_estimators: OptionType<IntegerType>;
163
+ /** Maximum tree depth (default 6) */
164
+ readonly max_depth: OptionType<IntegerType>;
165
+ /** Learning rate / step size shrinkage (default 0.3) */
166
+ readonly learning_rate: OptionType<FloatType>;
167
+ /** Minimum sum of instance weight needed in a child (default 1) */
168
+ readonly min_child_weight: OptionType<IntegerType>;
169
+ /** Subsample ratio of training instances (default 1.0) */
170
+ readonly subsample: OptionType<FloatType>;
171
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
172
+ readonly colsample_bytree: OptionType<FloatType>;
173
+ /** L1 regularization term (default 0) */
174
+ readonly reg_alpha: OptionType<FloatType>;
175
+ /** L2 regularization term (default 1) */
176
+ readonly reg_lambda: OptionType<FloatType>;
177
+ /** Minimum loss reduction required to make a further partition (default 0) */
178
+ readonly gamma: OptionType<FloatType>;
179
+ /** Random seed for reproducibility */
180
+ readonly random_state: OptionType<IntegerType>;
181
+ /** Number of parallel threads (default -1 for all cores) */
182
+ readonly n_jobs: OptionType<IntegerType>;
183
+ /** Sample weights for training (one per sample, default uniform) */
184
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
185
+ /** Column indices that contain categorical features (0-indexed) */
186
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
187
+ /** Number of categories per categorical feature (one per entry in categorical_features).
188
+ * Used to set explicit pandas Categorical range at both train and predict time,
189
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
190
+ * time, which XGBoost handles natively via learned default branch directions. */
191
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
192
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
193
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
194
+ /** Max categories considered per split for partition-based method (default 64). */
195
+ readonly max_cat_threshold: OptionType<IntegerType>;
196
+ }>], VariantType<{
197
+ /** XGBoost regressor model */
198
+ readonly xgboost_regressor: StructType<{
199
+ /** Cloudpickle serialized model */
200
+ readonly data: BlobType;
201
+ /** Number of input features */
202
+ readonly n_features: IntegerType;
203
+ /** Column indices of categorical features (for prediction) */
204
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
205
+ /** Number of categories per categorical feature (for consistent category space) */
206
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
207
+ }>;
208
+ /** XGBoost classifier model */
209
+ readonly xgboost_classifier: StructType<{
210
+ /** Cloudpickle serialized model */
211
+ readonly data: BlobType;
212
+ /** Number of input features */
213
+ readonly n_features: IntegerType;
214
+ /** Number of classes */
215
+ readonly n_classes: IntegerType;
216
+ /** Column indices of categorical features (for prediction) */
217
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
218
+ /** Number of categories per categorical feature (for consistent category space) */
219
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
220
+ }>;
221
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
222
+ readonly xgboost_quantile: StructType<{
223
+ /** Cloudpickle serialized dict of {quantile: model} */
224
+ readonly data: BlobType;
225
+ /** Quantiles this model predicts */
226
+ readonly quantiles: VectorType<FloatType>;
227
+ /** Number of input features */
228
+ readonly n_features: IntegerType;
229
+ /** Column indices of categorical features (for prediction) */
230
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
231
+ /** Number of categories per categorical feature (for consistent category space) */
232
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
233
+ }>;
234
+ }>>;
235
+ /**
236
+ * Train an XGBoost classification model.
237
+ *
238
+ * @param X - Feature matrix
239
+ * @param y - Label vector (integer class labels)
240
+ * @param config - XGBoost configuration
241
+ * @returns Model blob containing trained classifier
242
+ */
243
+ export declare const xgboost_train_classifier: import("@elaraai/east").PlatformDefinition<[MatrixType<FloatType>, VectorType<IntegerType>, StructType<{
244
+ /** Number of boosting rounds (default 100) */
245
+ readonly n_estimators: OptionType<IntegerType>;
246
+ /** Maximum tree depth (default 6) */
247
+ readonly max_depth: OptionType<IntegerType>;
248
+ /** Learning rate / step size shrinkage (default 0.3) */
249
+ readonly learning_rate: OptionType<FloatType>;
250
+ /** Minimum sum of instance weight needed in a child (default 1) */
251
+ readonly min_child_weight: OptionType<IntegerType>;
252
+ /** Subsample ratio of training instances (default 1.0) */
253
+ readonly subsample: OptionType<FloatType>;
254
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
255
+ readonly colsample_bytree: OptionType<FloatType>;
256
+ /** L1 regularization term (default 0) */
257
+ readonly reg_alpha: OptionType<FloatType>;
258
+ /** L2 regularization term (default 1) */
259
+ readonly reg_lambda: OptionType<FloatType>;
260
+ /** Minimum loss reduction required to make a further partition (default 0) */
261
+ readonly gamma: OptionType<FloatType>;
262
+ /** Random seed for reproducibility */
263
+ readonly random_state: OptionType<IntegerType>;
264
+ /** Number of parallel threads (default -1 for all cores) */
265
+ readonly n_jobs: OptionType<IntegerType>;
266
+ /** Sample weights for training (one per sample, default uniform) */
267
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
268
+ /** Column indices that contain categorical features (0-indexed) */
269
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
270
+ /** Number of categories per categorical feature (one per entry in categorical_features).
271
+ * Used to set explicit pandas Categorical range at both train and predict time,
272
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
273
+ * time, which XGBoost handles natively via learned default branch directions. */
274
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
275
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
276
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
277
+ /** Max categories considered per split for partition-based method (default 64). */
278
+ readonly max_cat_threshold: OptionType<IntegerType>;
279
+ }>], VariantType<{
280
+ /** XGBoost regressor model */
281
+ readonly xgboost_regressor: StructType<{
282
+ /** Cloudpickle serialized model */
283
+ readonly data: BlobType;
284
+ /** Number of input features */
285
+ readonly n_features: IntegerType;
286
+ /** Column indices of categorical features (for prediction) */
287
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
288
+ /** Number of categories per categorical feature (for consistent category space) */
289
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
290
+ }>;
291
+ /** XGBoost classifier model */
292
+ readonly xgboost_classifier: StructType<{
293
+ /** Cloudpickle serialized model */
294
+ readonly data: BlobType;
295
+ /** Number of input features */
296
+ readonly n_features: IntegerType;
297
+ /** Number of classes */
298
+ readonly n_classes: IntegerType;
299
+ /** Column indices of categorical features (for prediction) */
300
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
301
+ /** Number of categories per categorical feature (for consistent category space) */
302
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
303
+ }>;
304
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
305
+ readonly xgboost_quantile: StructType<{
306
+ /** Cloudpickle serialized dict of {quantile: model} */
307
+ readonly data: BlobType;
308
+ /** Quantiles this model predicts */
309
+ readonly quantiles: VectorType<FloatType>;
310
+ /** Number of input features */
311
+ readonly n_features: IntegerType;
312
+ /** Column indices of categorical features (for prediction) */
313
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
314
+ /** Number of categories per categorical feature (for consistent category space) */
315
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
316
+ }>;
317
+ }>>;
318
+ /**
319
+ * Make predictions with a trained XGBoost regressor.
320
+ *
321
+ * @param model - Trained regressor model blob
322
+ * @param X - Feature matrix
323
+ * @returns Predicted values
324
+ */
325
+ export declare const xgboost_predict: import("@elaraai/east").PlatformDefinition<[VariantType<{
326
+ /** XGBoost regressor model */
327
+ readonly xgboost_regressor: StructType<{
328
+ /** Cloudpickle serialized model */
329
+ readonly data: BlobType;
330
+ /** Number of input features */
331
+ readonly n_features: IntegerType;
332
+ /** Column indices of categorical features (for prediction) */
333
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
334
+ /** Number of categories per categorical feature (for consistent category space) */
335
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
336
+ }>;
337
+ /** XGBoost classifier model */
338
+ readonly xgboost_classifier: StructType<{
339
+ /** Cloudpickle serialized model */
340
+ readonly data: BlobType;
341
+ /** Number of input features */
342
+ readonly n_features: IntegerType;
343
+ /** Number of classes */
344
+ readonly n_classes: IntegerType;
345
+ /** Column indices of categorical features (for prediction) */
346
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
347
+ /** Number of categories per categorical feature (for consistent category space) */
348
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
349
+ }>;
350
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
351
+ readonly xgboost_quantile: StructType<{
352
+ /** Cloudpickle serialized dict of {quantile: model} */
353
+ readonly data: BlobType;
354
+ /** Quantiles this model predicts */
355
+ readonly quantiles: VectorType<FloatType>;
356
+ /** Number of input features */
357
+ readonly n_features: IntegerType;
358
+ /** Column indices of categorical features (for prediction) */
359
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
360
+ /** Number of categories per categorical feature (for consistent category space) */
361
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
362
+ }>;
363
+ }>, MatrixType<FloatType>], VectorType<FloatType>>;
364
+ /**
365
+ * Predict class labels with a trained XGBoost classifier.
366
+ *
367
+ * @param model - Trained classifier model blob
368
+ * @param X - Feature matrix
369
+ * @returns Predicted class labels
370
+ */
371
+ export declare const xgboost_predict_class: import("@elaraai/east").PlatformDefinition<[VariantType<{
372
+ /** XGBoost regressor model */
373
+ readonly xgboost_regressor: StructType<{
374
+ /** Cloudpickle serialized model */
375
+ readonly data: BlobType;
376
+ /** Number of input features */
377
+ readonly n_features: IntegerType;
378
+ /** Column indices of categorical features (for prediction) */
379
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
380
+ /** Number of categories per categorical feature (for consistent category space) */
381
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
382
+ }>;
383
+ /** XGBoost classifier model */
384
+ readonly xgboost_classifier: StructType<{
385
+ /** Cloudpickle serialized model */
386
+ readonly data: BlobType;
387
+ /** Number of input features */
388
+ readonly n_features: IntegerType;
389
+ /** Number of classes */
390
+ readonly n_classes: IntegerType;
391
+ /** Column indices of categorical features (for prediction) */
392
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
393
+ /** Number of categories per categorical feature (for consistent category space) */
394
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
395
+ }>;
396
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
397
+ readonly xgboost_quantile: StructType<{
398
+ /** Cloudpickle serialized dict of {quantile: model} */
399
+ readonly data: BlobType;
400
+ /** Quantiles this model predicts */
401
+ readonly quantiles: VectorType<FloatType>;
402
+ /** Number of input features */
403
+ readonly n_features: IntegerType;
404
+ /** Column indices of categorical features (for prediction) */
405
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
406
+ /** Number of categories per categorical feature (for consistent category space) */
407
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
408
+ }>;
409
+ }>, MatrixType<FloatType>], VectorType<IntegerType>>;
410
+ /**
411
+ * Get class probabilities from a trained XGBoost classifier.
412
+ *
413
+ * @param model - Trained classifier model blob
414
+ * @param X - Feature matrix
415
+ * @returns Probability matrix (n_samples x n_classes)
416
+ */
417
+ export declare const xgboost_predict_proba: import("@elaraai/east").PlatformDefinition<[VariantType<{
418
+ /** XGBoost regressor model */
419
+ readonly xgboost_regressor: StructType<{
420
+ /** Cloudpickle serialized model */
421
+ readonly data: BlobType;
422
+ /** Number of input features */
423
+ readonly n_features: IntegerType;
424
+ /** Column indices of categorical features (for prediction) */
425
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
426
+ /** Number of categories per categorical feature (for consistent category space) */
427
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
428
+ }>;
429
+ /** XGBoost classifier model */
430
+ readonly xgboost_classifier: StructType<{
431
+ /** Cloudpickle serialized model */
432
+ readonly data: BlobType;
433
+ /** Number of input features */
434
+ readonly n_features: IntegerType;
435
+ /** Number of classes */
436
+ readonly n_classes: IntegerType;
437
+ /** Column indices of categorical features (for prediction) */
438
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
439
+ /** Number of categories per categorical feature (for consistent category space) */
440
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
441
+ }>;
442
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
443
+ readonly xgboost_quantile: StructType<{
444
+ /** Cloudpickle serialized dict of {quantile: model} */
445
+ readonly data: BlobType;
446
+ /** Quantiles this model predicts */
447
+ readonly quantiles: VectorType<FloatType>;
448
+ /** Number of input features */
449
+ readonly n_features: IntegerType;
450
+ /** Column indices of categorical features (for prediction) */
451
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
452
+ /** Number of categories per categorical feature (for consistent category space) */
453
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
454
+ }>;
455
+ }>, MatrixType<FloatType>], MatrixType<FloatType>>;
456
+ /**
457
+ * Train XGBoost quantile regression models.
458
+ *
459
+ * Trains one model per quantile using pinball loss (reg:quantileerror).
460
+ * This provides prediction intervals and uncertainty quantification.
461
+ *
462
+ * @param X - Feature matrix
463
+ * @param y - Target vector
464
+ * @param config - Quantile regression configuration (includes quantiles array)
465
+ * @returns Model blob containing trained quantile models
466
+ */
467
+ export declare const xgboost_train_quantile: import("@elaraai/east").PlatformDefinition<[MatrixType<FloatType>, VectorType<FloatType>, StructType<{
468
+ /** Quantiles to predict (e.g., [0.1, 0.5, 0.9] for 80% interval + median) */
469
+ readonly quantiles: VectorType<FloatType>;
470
+ /** Number of boosting rounds (default 100) */
471
+ readonly n_estimators: OptionType<IntegerType>;
472
+ /** Maximum tree depth (default 6) */
473
+ readonly max_depth: OptionType<IntegerType>;
474
+ /** Learning rate / step size shrinkage (default 0.3) */
475
+ readonly learning_rate: OptionType<FloatType>;
476
+ /** Minimum sum of instance weight needed in a child (default 1) */
477
+ readonly min_child_weight: OptionType<IntegerType>;
478
+ /** Subsample ratio of training instances (default 1.0) */
479
+ readonly subsample: OptionType<FloatType>;
480
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
481
+ readonly colsample_bytree: OptionType<FloatType>;
482
+ /** L1 regularization term (default 0) */
483
+ readonly reg_alpha: OptionType<FloatType>;
484
+ /** L2 regularization term (default 1) */
485
+ readonly reg_lambda: OptionType<FloatType>;
486
+ /** Minimum loss reduction required to make a further partition (default 0) */
487
+ readonly gamma: OptionType<FloatType>;
488
+ /** Random seed for reproducibility */
489
+ readonly random_state: OptionType<IntegerType>;
490
+ /** Number of parallel threads (default -1 for all cores) */
491
+ readonly n_jobs: OptionType<IntegerType>;
492
+ /** Sample weights for training (one per sample, default uniform) */
493
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
494
+ /** Column indices that contain categorical features (0-indexed) */
495
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
496
+ /** Number of categories per categorical feature (one per entry in categorical_features).
497
+ * Used to set explicit pandas Categorical range at both train and predict time,
498
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
499
+ * time, which XGBoost handles natively via learned default branch directions. */
500
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
501
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
502
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
503
+ /** Max categories considered per split for partition-based method (default 64). */
504
+ readonly max_cat_threshold: OptionType<IntegerType>;
505
+ }>], VariantType<{
506
+ /** XGBoost regressor model */
507
+ readonly xgboost_regressor: StructType<{
508
+ /** Cloudpickle serialized model */
509
+ readonly data: BlobType;
510
+ /** Number of input features */
511
+ readonly n_features: IntegerType;
512
+ /** Column indices of categorical features (for prediction) */
513
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
514
+ /** Number of categories per categorical feature (for consistent category space) */
515
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
516
+ }>;
517
+ /** XGBoost classifier model */
518
+ readonly xgboost_classifier: StructType<{
519
+ /** Cloudpickle serialized model */
520
+ readonly data: BlobType;
521
+ /** Number of input features */
522
+ readonly n_features: IntegerType;
523
+ /** Number of classes */
524
+ readonly n_classes: IntegerType;
525
+ /** Column indices of categorical features (for prediction) */
526
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
527
+ /** Number of categories per categorical feature (for consistent category space) */
528
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
529
+ }>;
530
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
531
+ readonly xgboost_quantile: StructType<{
532
+ /** Cloudpickle serialized dict of {quantile: model} */
533
+ readonly data: BlobType;
534
+ /** Quantiles this model predicts */
535
+ readonly quantiles: VectorType<FloatType>;
536
+ /** Number of input features */
537
+ readonly n_features: IntegerType;
538
+ /** Column indices of categorical features (for prediction) */
539
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
540
+ /** Number of categories per categorical feature (for consistent category space) */
541
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
542
+ }>;
543
+ }>>;
544
+ /**
545
+ * Predict quantiles with trained XGBoost quantile regressor.
546
+ *
547
+ * @param model - Trained quantile model blob
548
+ * @param X - Feature matrix
549
+ * @returns Quantiles and predictions matrix (n_samples x n_quantiles)
550
+ */
551
+ export declare const xgboost_predict_quantile: import("@elaraai/east").PlatformDefinition<[VariantType<{
552
+ /** XGBoost regressor model */
553
+ readonly xgboost_regressor: StructType<{
554
+ /** Cloudpickle serialized model */
555
+ readonly data: BlobType;
556
+ /** Number of input features */
557
+ readonly n_features: IntegerType;
558
+ /** Column indices of categorical features (for prediction) */
559
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
560
+ /** Number of categories per categorical feature (for consistent category space) */
561
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
562
+ }>;
563
+ /** XGBoost classifier model */
564
+ readonly xgboost_classifier: StructType<{
565
+ /** Cloudpickle serialized model */
566
+ readonly data: BlobType;
567
+ /** Number of input features */
568
+ readonly n_features: IntegerType;
569
+ /** Number of classes */
570
+ readonly n_classes: IntegerType;
571
+ /** Column indices of categorical features (for prediction) */
572
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
573
+ /** Number of categories per categorical feature (for consistent category space) */
574
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
575
+ }>;
576
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
577
+ readonly xgboost_quantile: StructType<{
578
+ /** Cloudpickle serialized dict of {quantile: model} */
579
+ readonly data: BlobType;
580
+ /** Quantiles this model predicts */
581
+ readonly quantiles: VectorType<FloatType>;
582
+ /** Number of input features */
583
+ readonly n_features: IntegerType;
584
+ /** Column indices of categorical features (for prediction) */
585
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
586
+ /** Number of categories per categorical feature (for consistent category space) */
587
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
588
+ }>;
589
+ }>, MatrixType<FloatType>], StructType<{
590
+ /** Quantile values that were predicted */
591
+ readonly quantiles: VectorType<FloatType>;
592
+ /** Predictions matrix: (n_samples x n_quantiles) */
593
+ readonly predictions: MatrixType<FloatType>;
594
+ }>>;
595
+ /**
596
+ * Type definitions for XGBoost functions.
597
+ */
598
+ export declare const XGBoostTypes: {
599
+ /** XGBoost configuration type */
600
+ readonly XGBoostConfigType: StructType<{
601
+ /** Number of boosting rounds (default 100) */
602
+ readonly n_estimators: OptionType<IntegerType>;
603
+ /** Maximum tree depth (default 6) */
604
+ readonly max_depth: OptionType<IntegerType>;
605
+ /** Learning rate / step size shrinkage (default 0.3) */
606
+ readonly learning_rate: OptionType<FloatType>;
607
+ /** Minimum sum of instance weight needed in a child (default 1) */
608
+ readonly min_child_weight: OptionType<IntegerType>;
609
+ /** Subsample ratio of training instances (default 1.0) */
610
+ readonly subsample: OptionType<FloatType>;
611
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
612
+ readonly colsample_bytree: OptionType<FloatType>;
613
+ /** L1 regularization term (default 0) */
614
+ readonly reg_alpha: OptionType<FloatType>;
615
+ /** L2 regularization term (default 1) */
616
+ readonly reg_lambda: OptionType<FloatType>;
617
+ /** Minimum loss reduction required to make a further partition (default 0) */
618
+ readonly gamma: OptionType<FloatType>;
619
+ /** Random seed for reproducibility */
620
+ readonly random_state: OptionType<IntegerType>;
621
+ /** Number of parallel threads (default -1 for all cores) */
622
+ readonly n_jobs: OptionType<IntegerType>;
623
+ /** Sample weights for training (one per sample, default uniform) */
624
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
625
+ /** Column indices that contain categorical features (0-indexed) */
626
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
627
+ /** Number of categories per categorical feature (one per entry in categorical_features).
628
+ * Used to set explicit pandas Categorical range at both train and predict time,
629
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
630
+ * time, which XGBoost handles natively via learned default branch directions. */
631
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
632
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
633
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
634
+ /** Max categories considered per split for partition-based method (default 64). */
635
+ readonly max_cat_threshold: OptionType<IntegerType>;
636
+ }>;
637
+ /** XGBoost quantile configuration type */
638
+ readonly XGBoostQuantileConfigType: StructType<{
639
+ /** Quantiles to predict (e.g., [0.1, 0.5, 0.9] for 80% interval + median) */
640
+ readonly quantiles: VectorType<FloatType>;
641
+ /** Number of boosting rounds (default 100) */
642
+ readonly n_estimators: OptionType<IntegerType>;
643
+ /** Maximum tree depth (default 6) */
644
+ readonly max_depth: OptionType<IntegerType>;
645
+ /** Learning rate / step size shrinkage (default 0.3) */
646
+ readonly learning_rate: OptionType<FloatType>;
647
+ /** Minimum sum of instance weight needed in a child (default 1) */
648
+ readonly min_child_weight: OptionType<IntegerType>;
649
+ /** Subsample ratio of training instances (default 1.0) */
650
+ readonly subsample: OptionType<FloatType>;
651
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
652
+ readonly colsample_bytree: OptionType<FloatType>;
653
+ /** L1 regularization term (default 0) */
654
+ readonly reg_alpha: OptionType<FloatType>;
655
+ /** L2 regularization term (default 1) */
656
+ readonly reg_lambda: OptionType<FloatType>;
657
+ /** Minimum loss reduction required to make a further partition (default 0) */
658
+ readonly gamma: OptionType<FloatType>;
659
+ /** Random seed for reproducibility */
660
+ readonly random_state: OptionType<IntegerType>;
661
+ /** Number of parallel threads (default -1 for all cores) */
662
+ readonly n_jobs: OptionType<IntegerType>;
663
+ /** Sample weights for training (one per sample, default uniform) */
664
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
665
+ /** Column indices that contain categorical features (0-indexed) */
666
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
667
+ /** Number of categories per categorical feature (one per entry in categorical_features).
668
+ * Used to set explicit pandas Categorical range at both train and predict time,
669
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
670
+ * time, which XGBoost handles natively via learned default branch directions. */
671
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
672
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
673
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
674
+ /** Max categories considered per split for partition-based method (default 64). */
675
+ readonly max_cat_threshold: OptionType<IntegerType>;
676
+ }>;
677
+ /** Quantile prediction result type */
678
+ readonly XGBoostQuantilePredictResultType: StructType<{
679
+ /** Quantile values that were predicted */
680
+ readonly quantiles: VectorType<FloatType>;
681
+ /** Predictions matrix: (n_samples x n_quantiles) */
682
+ readonly predictions: MatrixType<FloatType>;
683
+ }>;
684
+ /** Model blob type for XGBoost models */
685
+ readonly ModelBlobType: VariantType<{
686
+ /** XGBoost regressor model */
687
+ readonly xgboost_regressor: StructType<{
688
+ /** Cloudpickle serialized model */
689
+ readonly data: BlobType;
690
+ /** Number of input features */
691
+ readonly n_features: IntegerType;
692
+ /** Column indices of categorical features (for prediction) */
693
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
694
+ /** Number of categories per categorical feature (for consistent category space) */
695
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
696
+ }>;
697
+ /** XGBoost classifier model */
698
+ readonly xgboost_classifier: StructType<{
699
+ /** Cloudpickle serialized model */
700
+ readonly data: BlobType;
701
+ /** Number of input features */
702
+ readonly n_features: IntegerType;
703
+ /** Number of classes */
704
+ readonly n_classes: IntegerType;
705
+ /** Column indices of categorical features (for prediction) */
706
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
707
+ /** Number of categories per categorical feature (for consistent category space) */
708
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
709
+ }>;
710
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
711
+ readonly xgboost_quantile: StructType<{
712
+ /** Cloudpickle serialized dict of {quantile: model} */
713
+ readonly data: BlobType;
714
+ /** Quantiles this model predicts */
715
+ readonly quantiles: VectorType<FloatType>;
716
+ /** Number of input features */
717
+ readonly n_features: IntegerType;
718
+ /** Column indices of categorical features (for prediction) */
719
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
720
+ /** Number of categories per categorical feature (for consistent category space) */
721
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
722
+ }>;
723
+ }>;
724
+ };
725
+ /**
726
+ * XGBoost gradient boosting.
727
+ *
728
+ * Provides regression and classification with gradient boosted decision trees.
729
+ *
730
+ * @example
731
+ * ```ts
732
+ * import { East, variant } from "@elaraai/east";
733
+ * import { XGBoost } from "@elaraai/east-py-datascience";
734
+ *
735
+ * const train = East.function([], XGBoost.Types.ModelBlobType, $ => {
736
+ * const X = $.let([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]);
737
+ * const y = $.let([1.0, 2.0, 3.0, 4.0]);
738
+ * const config = $.let({
739
+ * n_estimators: variant('some', 100n),
740
+ * max_depth: variant('some', 3n),
741
+ * learning_rate: variant('some', 0.1),
742
+ * min_child_weight: variant('none', null),
743
+ * subsample: variant('none', null),
744
+ * colsample_bytree: variant('none', null),
745
+ * reg_alpha: variant('none', null),
746
+ * reg_lambda: variant('none', null),
747
+ * random_state: variant('some', 42n),
748
+ * n_jobs: variant('none', null),
749
+ * sample_weight: variant('none', null),
750
+ * });
751
+ * return $.return(XGBoost.trainRegressor(X, y, config));
752
+ * });
753
+ * ```
754
+ */
755
+ export declare const XGBoost: {
756
+ /**
757
+ * Train an XGBoost regression model.
758
+ *
759
+ * @example
760
+ * ```ts
761
+ * import { East, FloatType, MatrixType, VectorType, variant } from "@elaraai/east";
762
+ * import { XGBoost, XGBoostConfigType } from "@elaraai/east-py-datascience";
763
+ *
764
+ * const train = East.function([], XGBoost.Types.ModelBlobType, ($) => {
765
+ * const X = $.let([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]);
766
+ * const y = $.let(new Float64Array([1.0, 2.0, 3.0, 4.0]));
767
+ * const config = $.let({
768
+ * n_estimators: variant("some", 100n), max_depth: variant("some", 3n),
769
+ * learning_rate: variant("some", 0.1), min_child_weight: variant("none", null),
770
+ * subsample: variant("none", null), colsample_bytree: variant("none", null),
771
+ * reg_alpha: variant("none", null), reg_lambda: variant("none", null),
772
+ * gamma: variant("none", null), random_state: variant("some", 42n),
773
+ * n_jobs: variant("none", null), sample_weight: variant("none", null),
774
+ * categorical_features: variant("none", null), categorical_n: variant("none", null),
775
+ * max_cat_to_onehot: variant("none", null), max_cat_threshold: variant("none", null),
776
+ * }, XGBoostConfigType);
777
+ * return $.return(XGBoost.trainRegressor(X, y, config));
778
+ * });
779
+ * ```
780
+ */
781
+ readonly trainRegressor: import("@elaraai/east").PlatformDefinition<[MatrixType<FloatType>, VectorType<FloatType>, StructType<{
782
+ /** Number of boosting rounds (default 100) */
783
+ readonly n_estimators: OptionType<IntegerType>;
784
+ /** Maximum tree depth (default 6) */
785
+ readonly max_depth: OptionType<IntegerType>;
786
+ /** Learning rate / step size shrinkage (default 0.3) */
787
+ readonly learning_rate: OptionType<FloatType>;
788
+ /** Minimum sum of instance weight needed in a child (default 1) */
789
+ readonly min_child_weight: OptionType<IntegerType>;
790
+ /** Subsample ratio of training instances (default 1.0) */
791
+ readonly subsample: OptionType<FloatType>;
792
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
793
+ readonly colsample_bytree: OptionType<FloatType>;
794
+ /** L1 regularization term (default 0) */
795
+ readonly reg_alpha: OptionType<FloatType>;
796
+ /** L2 regularization term (default 1) */
797
+ readonly reg_lambda: OptionType<FloatType>;
798
+ /** Minimum loss reduction required to make a further partition (default 0) */
799
+ readonly gamma: OptionType<FloatType>;
800
+ /** Random seed for reproducibility */
801
+ readonly random_state: OptionType<IntegerType>;
802
+ /** Number of parallel threads (default -1 for all cores) */
803
+ readonly n_jobs: OptionType<IntegerType>;
804
+ /** Sample weights for training (one per sample, default uniform) */
805
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
806
+ /** Column indices that contain categorical features (0-indexed) */
807
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
808
+ /** Number of categories per categorical feature (one per entry in categorical_features).
809
+ * Used to set explicit pandas Categorical range at both train and predict time,
810
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
811
+ * time, which XGBoost handles natively via learned default branch directions. */
812
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
813
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
814
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
815
+ /** Max categories considered per split for partition-based method (default 64). */
816
+ readonly max_cat_threshold: OptionType<IntegerType>;
817
+ }>], VariantType<{
818
+ /** XGBoost regressor model */
819
+ readonly xgboost_regressor: StructType<{
820
+ /** Cloudpickle serialized model */
821
+ readonly data: BlobType;
822
+ /** Number of input features */
823
+ readonly n_features: IntegerType;
824
+ /** Column indices of categorical features (for prediction) */
825
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
826
+ /** Number of categories per categorical feature (for consistent category space) */
827
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
828
+ }>;
829
+ /** XGBoost classifier model */
830
+ readonly xgboost_classifier: StructType<{
831
+ /** Cloudpickle serialized model */
832
+ readonly data: BlobType;
833
+ /** Number of input features */
834
+ readonly n_features: IntegerType;
835
+ /** Number of classes */
836
+ readonly n_classes: IntegerType;
837
+ /** Column indices of categorical features (for prediction) */
838
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
839
+ /** Number of categories per categorical feature (for consistent category space) */
840
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
841
+ }>;
842
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
843
+ readonly xgboost_quantile: StructType<{
844
+ /** Cloudpickle serialized dict of {quantile: model} */
845
+ readonly data: BlobType;
846
+ /** Quantiles this model predicts */
847
+ readonly quantiles: VectorType<FloatType>;
848
+ /** Number of input features */
849
+ readonly n_features: IntegerType;
850
+ /** Column indices of categorical features (for prediction) */
851
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
852
+ /** Number of categories per categorical feature (for consistent category space) */
853
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
854
+ }>;
855
+ }>>;
856
+ /**
857
+ * Train an XGBoost classification model.
858
+ *
859
+ * @example
860
+ * ```ts
861
+ * import { East, FloatType, IntegerType, MatrixType, VectorType, variant } from "@elaraai/east";
862
+ * import { XGBoost, XGBoostConfigType } from "@elaraai/east-py-datascience";
863
+ *
864
+ * const train = East.function([], XGBoost.Types.ModelBlobType, ($) => {
865
+ * const X = $.let([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]);
866
+ * const y = $.let(new BigInt64Array([0n, 1n, 0n, 1n]));
867
+ * const config = $.let({
868
+ * n_estimators: variant("some", 50n), max_depth: variant("some", 3n),
869
+ * learning_rate: variant("some", 0.1), min_child_weight: variant("none", null),
870
+ * subsample: variant("none", null), colsample_bytree: variant("none", null),
871
+ * reg_alpha: variant("none", null), reg_lambda: variant("none", null),
872
+ * gamma: variant("none", null), random_state: variant("some", 42n),
873
+ * n_jobs: variant("none", null), sample_weight: variant("none", null),
874
+ * categorical_features: variant("none", null), categorical_n: variant("none", null),
875
+ * max_cat_to_onehot: variant("none", null), max_cat_threshold: variant("none", null),
876
+ * }, XGBoostConfigType);
877
+ * return $.return(XGBoost.trainClassifier(X, y, config));
878
+ * });
879
+ * ```
880
+ */
881
+ readonly trainClassifier: import("@elaraai/east").PlatformDefinition<[MatrixType<FloatType>, VectorType<IntegerType>, StructType<{
882
+ /** Number of boosting rounds (default 100) */
883
+ readonly n_estimators: OptionType<IntegerType>;
884
+ /** Maximum tree depth (default 6) */
885
+ readonly max_depth: OptionType<IntegerType>;
886
+ /** Learning rate / step size shrinkage (default 0.3) */
887
+ readonly learning_rate: OptionType<FloatType>;
888
+ /** Minimum sum of instance weight needed in a child (default 1) */
889
+ readonly min_child_weight: OptionType<IntegerType>;
890
+ /** Subsample ratio of training instances (default 1.0) */
891
+ readonly subsample: OptionType<FloatType>;
892
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
893
+ readonly colsample_bytree: OptionType<FloatType>;
894
+ /** L1 regularization term (default 0) */
895
+ readonly reg_alpha: OptionType<FloatType>;
896
+ /** L2 regularization term (default 1) */
897
+ readonly reg_lambda: OptionType<FloatType>;
898
+ /** Minimum loss reduction required to make a further partition (default 0) */
899
+ readonly gamma: OptionType<FloatType>;
900
+ /** Random seed for reproducibility */
901
+ readonly random_state: OptionType<IntegerType>;
902
+ /** Number of parallel threads (default -1 for all cores) */
903
+ readonly n_jobs: OptionType<IntegerType>;
904
+ /** Sample weights for training (one per sample, default uniform) */
905
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
906
+ /** Column indices that contain categorical features (0-indexed) */
907
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
908
+ /** Number of categories per categorical feature (one per entry in categorical_features).
909
+ * Used to set explicit pandas Categorical range at both train and predict time,
910
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
911
+ * time, which XGBoost handles natively via learned default branch directions. */
912
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
913
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
914
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
915
+ /** Max categories considered per split for partition-based method (default 64). */
916
+ readonly max_cat_threshold: OptionType<IntegerType>;
917
+ }>], VariantType<{
918
+ /** XGBoost regressor model */
919
+ readonly xgboost_regressor: StructType<{
920
+ /** Cloudpickle serialized model */
921
+ readonly data: BlobType;
922
+ /** Number of input features */
923
+ readonly n_features: IntegerType;
924
+ /** Column indices of categorical features (for prediction) */
925
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
926
+ /** Number of categories per categorical feature (for consistent category space) */
927
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
928
+ }>;
929
+ /** XGBoost classifier model */
930
+ readonly xgboost_classifier: StructType<{
931
+ /** Cloudpickle serialized model */
932
+ readonly data: BlobType;
933
+ /** Number of input features */
934
+ readonly n_features: IntegerType;
935
+ /** Number of classes */
936
+ readonly n_classes: IntegerType;
937
+ /** Column indices of categorical features (for prediction) */
938
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
939
+ /** Number of categories per categorical feature (for consistent category space) */
940
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
941
+ }>;
942
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
943
+ readonly xgboost_quantile: StructType<{
944
+ /** Cloudpickle serialized dict of {quantile: model} */
945
+ readonly data: BlobType;
946
+ /** Quantiles this model predicts */
947
+ readonly quantiles: VectorType<FloatType>;
948
+ /** Number of input features */
949
+ readonly n_features: IntegerType;
950
+ /** Column indices of categorical features (for prediction) */
951
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
952
+ /** Number of categories per categorical feature (for consistent category space) */
953
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
954
+ }>;
955
+ }>>;
956
+ /**
957
+ * Train XGBoost quantile regression models.
958
+ *
959
+ * Trains one model per quantile using pinball loss, providing
960
+ * prediction intervals and uncertainty quantification.
961
+ *
962
+ * @example
963
+ * ```ts
964
+ * import { East, FloatType, MatrixType, VectorType, variant } from "@elaraai/east";
965
+ * import { XGBoost, XGBoostQuantileConfigType } from "@elaraai/east-py-datascience";
966
+ *
967
+ * const train = East.function([], XGBoost.Types.ModelBlobType, ($) => {
968
+ * const X = $.let([[1.0], [2.0], [3.0], [4.0]]);
969
+ * const y = $.let(new Float64Array([1.0, 2.0, 3.0, 4.0]));
970
+ * const config = $.let({
971
+ * quantiles: new Float64Array([0.1, 0.5, 0.9]),
972
+ * n_estimators: variant("some", 100n), max_depth: variant("some", 3n),
973
+ * learning_rate: variant("some", 0.1), min_child_weight: variant("none", null),
974
+ * subsample: variant("none", null), colsample_bytree: variant("none", null),
975
+ * reg_alpha: variant("none", null), reg_lambda: variant("none", null),
976
+ * gamma: variant("none", null), random_state: variant("some", 42n),
977
+ * n_jobs: variant("none", null), sample_weight: variant("none", null),
978
+ * categorical_features: variant("none", null), categorical_n: variant("none", null),
979
+ * max_cat_to_onehot: variant("none", null), max_cat_threshold: variant("none", null),
980
+ * }, XGBoostQuantileConfigType);
981
+ * return $.return(XGBoost.trainQuantile(X, y, config));
982
+ * });
983
+ * ```
984
+ */
985
+ readonly trainQuantile: import("@elaraai/east").PlatformDefinition<[MatrixType<FloatType>, VectorType<FloatType>, StructType<{
986
+ /** Quantiles to predict (e.g., [0.1, 0.5, 0.9] for 80% interval + median) */
987
+ readonly quantiles: VectorType<FloatType>;
988
+ /** Number of boosting rounds (default 100) */
989
+ readonly n_estimators: OptionType<IntegerType>;
990
+ /** Maximum tree depth (default 6) */
991
+ readonly max_depth: OptionType<IntegerType>;
992
+ /** Learning rate / step size shrinkage (default 0.3) */
993
+ readonly learning_rate: OptionType<FloatType>;
994
+ /** Minimum sum of instance weight needed in a child (default 1) */
995
+ readonly min_child_weight: OptionType<IntegerType>;
996
+ /** Subsample ratio of training instances (default 1.0) */
997
+ readonly subsample: OptionType<FloatType>;
998
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
999
+ readonly colsample_bytree: OptionType<FloatType>;
1000
+ /** L1 regularization term (default 0) */
1001
+ readonly reg_alpha: OptionType<FloatType>;
1002
+ /** L2 regularization term (default 1) */
1003
+ readonly reg_lambda: OptionType<FloatType>;
1004
+ /** Minimum loss reduction required to make a further partition (default 0) */
1005
+ readonly gamma: OptionType<FloatType>;
1006
+ /** Random seed for reproducibility */
1007
+ readonly random_state: OptionType<IntegerType>;
1008
+ /** Number of parallel threads (default -1 for all cores) */
1009
+ readonly n_jobs: OptionType<IntegerType>;
1010
+ /** Sample weights for training (one per sample, default uniform) */
1011
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
1012
+ /** Column indices that contain categorical features (0-indexed) */
1013
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1014
+ /** Number of categories per categorical feature (one per entry in categorical_features).
1015
+ * Used to set explicit pandas Categorical range at both train and predict time,
1016
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
1017
+ * time, which XGBoost handles natively via learned default branch directions. */
1018
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1019
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
1020
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
1021
+ /** Max categories considered per split for partition-based method (default 64). */
1022
+ readonly max_cat_threshold: OptionType<IntegerType>;
1023
+ }>], VariantType<{
1024
+ /** XGBoost regressor model */
1025
+ readonly xgboost_regressor: StructType<{
1026
+ /** Cloudpickle serialized model */
1027
+ readonly data: BlobType;
1028
+ /** Number of input features */
1029
+ readonly n_features: IntegerType;
1030
+ /** Column indices of categorical features (for prediction) */
1031
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1032
+ /** Number of categories per categorical feature (for consistent category space) */
1033
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1034
+ }>;
1035
+ /** XGBoost classifier model */
1036
+ readonly xgboost_classifier: StructType<{
1037
+ /** Cloudpickle serialized model */
1038
+ readonly data: BlobType;
1039
+ /** Number of input features */
1040
+ readonly n_features: IntegerType;
1041
+ /** Number of classes */
1042
+ readonly n_classes: IntegerType;
1043
+ /** Column indices of categorical features (for prediction) */
1044
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1045
+ /** Number of categories per categorical feature (for consistent category space) */
1046
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1047
+ }>;
1048
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
1049
+ readonly xgboost_quantile: StructType<{
1050
+ /** Cloudpickle serialized dict of {quantile: model} */
1051
+ readonly data: BlobType;
1052
+ /** Quantiles this model predicts */
1053
+ readonly quantiles: VectorType<FloatType>;
1054
+ /** Number of input features */
1055
+ readonly n_features: IntegerType;
1056
+ /** Column indices of categorical features (for prediction) */
1057
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1058
+ /** Number of categories per categorical feature (for consistent category space) */
1059
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1060
+ }>;
1061
+ }>>;
1062
+ /**
1063
+ * Make predictions with a trained XGBoost regressor.
1064
+ *
1065
+ * @example
1066
+ * ```ts
1067
+ * import { East, FloatType, MatrixType, VectorType } from "@elaraai/east";
1068
+ * import { XGBoost } from "@elaraai/east-py-datascience";
1069
+ *
1070
+ * const predictFn = East.function(
1071
+ * [XGBoost.Types.ModelBlobType, MatrixType(FloatType)],
1072
+ * VectorType(FloatType),
1073
+ * ($, model, X) => {
1074
+ * return $.return(XGBoost.predict(model, X));
1075
+ * }
1076
+ * );
1077
+ * ```
1078
+ */
1079
+ readonly predict: import("@elaraai/east").PlatformDefinition<[VariantType<{
1080
+ /** XGBoost regressor model */
1081
+ readonly xgboost_regressor: StructType<{
1082
+ /** Cloudpickle serialized model */
1083
+ readonly data: BlobType;
1084
+ /** Number of input features */
1085
+ readonly n_features: IntegerType;
1086
+ /** Column indices of categorical features (for prediction) */
1087
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1088
+ /** Number of categories per categorical feature (for consistent category space) */
1089
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1090
+ }>;
1091
+ /** XGBoost classifier model */
1092
+ readonly xgboost_classifier: StructType<{
1093
+ /** Cloudpickle serialized model */
1094
+ readonly data: BlobType;
1095
+ /** Number of input features */
1096
+ readonly n_features: IntegerType;
1097
+ /** Number of classes */
1098
+ readonly n_classes: IntegerType;
1099
+ /** Column indices of categorical features (for prediction) */
1100
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1101
+ /** Number of categories per categorical feature (for consistent category space) */
1102
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1103
+ }>;
1104
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
1105
+ readonly xgboost_quantile: StructType<{
1106
+ /** Cloudpickle serialized dict of {quantile: model} */
1107
+ readonly data: BlobType;
1108
+ /** Quantiles this model predicts */
1109
+ readonly quantiles: VectorType<FloatType>;
1110
+ /** Number of input features */
1111
+ readonly n_features: IntegerType;
1112
+ /** Column indices of categorical features (for prediction) */
1113
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1114
+ /** Number of categories per categorical feature (for consistent category space) */
1115
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1116
+ }>;
1117
+ }>, MatrixType<FloatType>], VectorType<FloatType>>;
1118
+ /**
1119
+ * Predict class labels with a trained XGBoost classifier.
1120
+ *
1121
+ * @example
1122
+ * ```ts
1123
+ * import { East, FloatType, IntegerType, MatrixType, VectorType } from "@elaraai/east";
1124
+ * import { XGBoost } from "@elaraai/east-py-datascience";
1125
+ *
1126
+ * const predictFn = East.function(
1127
+ * [XGBoost.Types.ModelBlobType, MatrixType(FloatType)],
1128
+ * VectorType(IntegerType),
1129
+ * ($, model, X) => {
1130
+ * return $.return(XGBoost.predictClass(model, X));
1131
+ * }
1132
+ * );
1133
+ * ```
1134
+ */
1135
+ readonly predictClass: import("@elaraai/east").PlatformDefinition<[VariantType<{
1136
+ /** XGBoost regressor model */
1137
+ readonly xgboost_regressor: StructType<{
1138
+ /** Cloudpickle serialized model */
1139
+ readonly data: BlobType;
1140
+ /** Number of input features */
1141
+ readonly n_features: IntegerType;
1142
+ /** Column indices of categorical features (for prediction) */
1143
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1144
+ /** Number of categories per categorical feature (for consistent category space) */
1145
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1146
+ }>;
1147
+ /** XGBoost classifier model */
1148
+ readonly xgboost_classifier: StructType<{
1149
+ /** Cloudpickle serialized model */
1150
+ readonly data: BlobType;
1151
+ /** Number of input features */
1152
+ readonly n_features: IntegerType;
1153
+ /** Number of classes */
1154
+ readonly n_classes: IntegerType;
1155
+ /** Column indices of categorical features (for prediction) */
1156
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1157
+ /** Number of categories per categorical feature (for consistent category space) */
1158
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1159
+ }>;
1160
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
1161
+ readonly xgboost_quantile: StructType<{
1162
+ /** Cloudpickle serialized dict of {quantile: model} */
1163
+ readonly data: BlobType;
1164
+ /** Quantiles this model predicts */
1165
+ readonly quantiles: VectorType<FloatType>;
1166
+ /** Number of input features */
1167
+ readonly n_features: IntegerType;
1168
+ /** Column indices of categorical features (for prediction) */
1169
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1170
+ /** Number of categories per categorical feature (for consistent category space) */
1171
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1172
+ }>;
1173
+ }>, MatrixType<FloatType>], VectorType<IntegerType>>;
1174
+ /**
1175
+ * Get class probabilities from a trained XGBoost classifier.
1176
+ *
1177
+ * @example
1178
+ * ```ts
1179
+ * import { East, FloatType, MatrixType } from "@elaraai/east";
1180
+ * import { XGBoost } from "@elaraai/east-py-datascience";
1181
+ *
1182
+ * const predictFn = East.function(
1183
+ * [XGBoost.Types.ModelBlobType, MatrixType(FloatType)],
1184
+ * MatrixType(FloatType),
1185
+ * ($, model, X) => {
1186
+ * // Returns (n_samples x n_classes) probability matrix
1187
+ * return $.return(XGBoost.predictProba(model, X));
1188
+ * }
1189
+ * );
1190
+ * ```
1191
+ */
1192
+ readonly predictProba: import("@elaraai/east").PlatformDefinition<[VariantType<{
1193
+ /** XGBoost regressor model */
1194
+ readonly xgboost_regressor: StructType<{
1195
+ /** Cloudpickle serialized model */
1196
+ readonly data: BlobType;
1197
+ /** Number of input features */
1198
+ readonly n_features: IntegerType;
1199
+ /** Column indices of categorical features (for prediction) */
1200
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1201
+ /** Number of categories per categorical feature (for consistent category space) */
1202
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1203
+ }>;
1204
+ /** XGBoost classifier model */
1205
+ readonly xgboost_classifier: StructType<{
1206
+ /** Cloudpickle serialized model */
1207
+ readonly data: BlobType;
1208
+ /** Number of input features */
1209
+ readonly n_features: IntegerType;
1210
+ /** Number of classes */
1211
+ readonly n_classes: IntegerType;
1212
+ /** Column indices of categorical features (for prediction) */
1213
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1214
+ /** Number of categories per categorical feature (for consistent category space) */
1215
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1216
+ }>;
1217
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
1218
+ readonly xgboost_quantile: StructType<{
1219
+ /** Cloudpickle serialized dict of {quantile: model} */
1220
+ readonly data: BlobType;
1221
+ /** Quantiles this model predicts */
1222
+ readonly quantiles: VectorType<FloatType>;
1223
+ /** Number of input features */
1224
+ readonly n_features: IntegerType;
1225
+ /** Column indices of categorical features (for prediction) */
1226
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1227
+ /** Number of categories per categorical feature (for consistent category space) */
1228
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1229
+ }>;
1230
+ }>, MatrixType<FloatType>], MatrixType<FloatType>>;
1231
+ /**
1232
+ * Predict quantiles with a trained XGBoost quantile regressor.
1233
+ *
1234
+ * @example
1235
+ * ```ts
1236
+ * import { East, FloatType, MatrixType } from "@elaraai/east";
1237
+ * import { XGBoost } from "@elaraai/east-py-datascience";
1238
+ *
1239
+ * const predictFn = East.function(
1240
+ * [XGBoost.Types.ModelBlobType, MatrixType(FloatType)],
1241
+ * XGBoost.Types.XGBoostQuantilePredictResultType,
1242
+ * ($, model, X) => {
1243
+ * const result = $.let(XGBoost.predictQuantile(model, X));
1244
+ * // result.quantiles => [0.1, 0.5, 0.9]
1245
+ * // result.predictions => (n_samples x n_quantiles) matrix
1246
+ * return $.return(result);
1247
+ * }
1248
+ * );
1249
+ * ```
1250
+ */
1251
+ readonly predictQuantile: import("@elaraai/east").PlatformDefinition<[VariantType<{
1252
+ /** XGBoost regressor model */
1253
+ readonly xgboost_regressor: StructType<{
1254
+ /** Cloudpickle serialized model */
1255
+ readonly data: BlobType;
1256
+ /** Number of input features */
1257
+ readonly n_features: IntegerType;
1258
+ /** Column indices of categorical features (for prediction) */
1259
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1260
+ /** Number of categories per categorical feature (for consistent category space) */
1261
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1262
+ }>;
1263
+ /** XGBoost classifier model */
1264
+ readonly xgboost_classifier: StructType<{
1265
+ /** Cloudpickle serialized model */
1266
+ readonly data: BlobType;
1267
+ /** Number of input features */
1268
+ readonly n_features: IntegerType;
1269
+ /** Number of classes */
1270
+ readonly n_classes: IntegerType;
1271
+ /** Column indices of categorical features (for prediction) */
1272
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1273
+ /** Number of categories per categorical feature (for consistent category space) */
1274
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1275
+ }>;
1276
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
1277
+ readonly xgboost_quantile: StructType<{
1278
+ /** Cloudpickle serialized dict of {quantile: model} */
1279
+ readonly data: BlobType;
1280
+ /** Quantiles this model predicts */
1281
+ readonly quantiles: VectorType<FloatType>;
1282
+ /** Number of input features */
1283
+ readonly n_features: IntegerType;
1284
+ /** Column indices of categorical features (for prediction) */
1285
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1286
+ /** Number of categories per categorical feature (for consistent category space) */
1287
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1288
+ }>;
1289
+ }>, MatrixType<FloatType>], StructType<{
1290
+ /** Quantile values that were predicted */
1291
+ readonly quantiles: VectorType<FloatType>;
1292
+ /** Predictions matrix: (n_samples x n_quantiles) */
1293
+ readonly predictions: MatrixType<FloatType>;
1294
+ }>>;
1295
+ /** Type definitions */
1296
+ readonly Types: {
1297
+ /** XGBoost configuration type */
1298
+ readonly XGBoostConfigType: StructType<{
1299
+ /** Number of boosting rounds (default 100) */
1300
+ readonly n_estimators: OptionType<IntegerType>;
1301
+ /** Maximum tree depth (default 6) */
1302
+ readonly max_depth: OptionType<IntegerType>;
1303
+ /** Learning rate / step size shrinkage (default 0.3) */
1304
+ readonly learning_rate: OptionType<FloatType>;
1305
+ /** Minimum sum of instance weight needed in a child (default 1) */
1306
+ readonly min_child_weight: OptionType<IntegerType>;
1307
+ /** Subsample ratio of training instances (default 1.0) */
1308
+ readonly subsample: OptionType<FloatType>;
1309
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
1310
+ readonly colsample_bytree: OptionType<FloatType>;
1311
+ /** L1 regularization term (default 0) */
1312
+ readonly reg_alpha: OptionType<FloatType>;
1313
+ /** L2 regularization term (default 1) */
1314
+ readonly reg_lambda: OptionType<FloatType>;
1315
+ /** Minimum loss reduction required to make a further partition (default 0) */
1316
+ readonly gamma: OptionType<FloatType>;
1317
+ /** Random seed for reproducibility */
1318
+ readonly random_state: OptionType<IntegerType>;
1319
+ /** Number of parallel threads (default -1 for all cores) */
1320
+ readonly n_jobs: OptionType<IntegerType>;
1321
+ /** Sample weights for training (one per sample, default uniform) */
1322
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
1323
+ /** Column indices that contain categorical features (0-indexed) */
1324
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1325
+ /** Number of categories per categorical feature (one per entry in categorical_features).
1326
+ * Used to set explicit pandas Categorical range at both train and predict time,
1327
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
1328
+ * time, which XGBoost handles natively via learned default branch directions. */
1329
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1330
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
1331
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
1332
+ /** Max categories considered per split for partition-based method (default 64). */
1333
+ readonly max_cat_threshold: OptionType<IntegerType>;
1334
+ }>;
1335
+ /** XGBoost quantile configuration type */
1336
+ readonly XGBoostQuantileConfigType: StructType<{
1337
+ /** Quantiles to predict (e.g., [0.1, 0.5, 0.9] for 80% interval + median) */
1338
+ readonly quantiles: VectorType<FloatType>;
1339
+ /** Number of boosting rounds (default 100) */
1340
+ readonly n_estimators: OptionType<IntegerType>;
1341
+ /** Maximum tree depth (default 6) */
1342
+ readonly max_depth: OptionType<IntegerType>;
1343
+ /** Learning rate / step size shrinkage (default 0.3) */
1344
+ readonly learning_rate: OptionType<FloatType>;
1345
+ /** Minimum sum of instance weight needed in a child (default 1) */
1346
+ readonly min_child_weight: OptionType<IntegerType>;
1347
+ /** Subsample ratio of training instances (default 1.0) */
1348
+ readonly subsample: OptionType<FloatType>;
1349
+ /** Subsample ratio of columns when constructing trees (default 1.0) */
1350
+ readonly colsample_bytree: OptionType<FloatType>;
1351
+ /** L1 regularization term (default 0) */
1352
+ readonly reg_alpha: OptionType<FloatType>;
1353
+ /** L2 regularization term (default 1) */
1354
+ readonly reg_lambda: OptionType<FloatType>;
1355
+ /** Minimum loss reduction required to make a further partition (default 0) */
1356
+ readonly gamma: OptionType<FloatType>;
1357
+ /** Random seed for reproducibility */
1358
+ readonly random_state: OptionType<IntegerType>;
1359
+ /** Number of parallel threads (default -1 for all cores) */
1360
+ readonly n_jobs: OptionType<IntegerType>;
1361
+ /** Sample weights for training (one per sample, default uniform) */
1362
+ readonly sample_weight: OptionType<VectorType<FloatType>>;
1363
+ /** Column indices that contain categorical features (0-indexed) */
1364
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1365
+ /** Number of categories per categorical feature (one per entry in categorical_features).
1366
+ * Used to set explicit pandas Categorical range at both train and predict time,
1367
+ * ensuring consistent category spaces. Values outside [0, n) become NaN at predict
1368
+ * time, which XGBoost handles natively via learned default branch directions. */
1369
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1370
+ /** Max categories for one-hot encoding (default 4). Features with more categories use partition-based splits. */
1371
+ readonly max_cat_to_onehot: OptionType<IntegerType>;
1372
+ /** Max categories considered per split for partition-based method (default 64). */
1373
+ readonly max_cat_threshold: OptionType<IntegerType>;
1374
+ }>;
1375
+ /** Quantile prediction result type */
1376
+ readonly XGBoostQuantilePredictResultType: StructType<{
1377
+ /** Quantile values that were predicted */
1378
+ readonly quantiles: VectorType<FloatType>;
1379
+ /** Predictions matrix: (n_samples x n_quantiles) */
1380
+ readonly predictions: MatrixType<FloatType>;
1381
+ }>;
1382
+ /** Model blob type for XGBoost models */
1383
+ readonly ModelBlobType: VariantType<{
1384
+ /** XGBoost regressor model */
1385
+ readonly xgboost_regressor: StructType<{
1386
+ /** Cloudpickle serialized model */
1387
+ readonly data: BlobType;
1388
+ /** Number of input features */
1389
+ readonly n_features: IntegerType;
1390
+ /** Column indices of categorical features (for prediction) */
1391
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1392
+ /** Number of categories per categorical feature (for consistent category space) */
1393
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1394
+ }>;
1395
+ /** XGBoost classifier model */
1396
+ readonly xgboost_classifier: StructType<{
1397
+ /** Cloudpickle serialized model */
1398
+ readonly data: BlobType;
1399
+ /** Number of input features */
1400
+ readonly n_features: IntegerType;
1401
+ /** Number of classes */
1402
+ readonly n_classes: IntegerType;
1403
+ /** Column indices of categorical features (for prediction) */
1404
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1405
+ /** Number of categories per categorical feature (for consistent category space) */
1406
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1407
+ }>;
1408
+ /** XGBoost quantile regressor (multiple models, one per quantile) */
1409
+ readonly xgboost_quantile: StructType<{
1410
+ /** Cloudpickle serialized dict of {quantile: model} */
1411
+ readonly data: BlobType;
1412
+ /** Quantiles this model predicts */
1413
+ readonly quantiles: VectorType<FloatType>;
1414
+ /** Number of input features */
1415
+ readonly n_features: IntegerType;
1416
+ /** Column indices of categorical features (for prediction) */
1417
+ readonly categorical_features: OptionType<VectorType<IntegerType>>;
1418
+ /** Number of categories per categorical feature (for consistent category space) */
1419
+ readonly categorical_n: OptionType<VectorType<IntegerType>>;
1420
+ }>;
1421
+ }>;
1422
+ };
1423
+ };
1424
+ //# sourceMappingURL=xgboost.d.ts.map