@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.
- package/LICENSE.md +18 -0
- package/README.md +104 -0
- package/dist/gp/gp.d.ts +398 -0
- package/dist/gp/gp.d.ts.map +1 -0
- package/dist/gp/gp.js +170 -0
- package/dist/gp/gp.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/lightgbm/lightgbm.d.ts +494 -0
- package/dist/lightgbm/lightgbm.d.ts.map +1 -0
- package/dist/lightgbm/lightgbm.js +155 -0
- package/dist/lightgbm/lightgbm.js.map +1 -0
- package/dist/mads/mads.d.ts +413 -0
- package/dist/mads/mads.d.ts.map +1 -0
- package/dist/mads/mads.js +221 -0
- package/dist/mads/mads.js.map +1 -0
- package/dist/ngboost/ngboost.d.ts +433 -0
- package/dist/ngboost/ngboost.d.ts.map +1 -0
- package/dist/ngboost/ngboost.js +178 -0
- package/dist/ngboost/ngboost.js.map +1 -0
- package/dist/optuna/optuna.d.ts +797 -0
- package/dist/optuna/optuna.d.ts.map +1 -0
- package/dist/optuna/optuna.js +268 -0
- package/dist/optuna/optuna.js.map +1 -0
- package/dist/scipy/scipy.d.ts +954 -0
- package/dist/scipy/scipy.d.ts.map +1 -0
- package/dist/scipy/scipy.js +287 -0
- package/dist/scipy/scipy.js.map +1 -0
- package/dist/shap/shap.d.ts +657 -0
- package/dist/shap/shap.d.ts.map +1 -0
- package/dist/shap/shap.js +241 -0
- package/dist/shap/shap.js.map +1 -0
- package/dist/simanneal/simanneal.d.ts +531 -0
- package/dist/simanneal/simanneal.d.ts.map +1 -0
- package/dist/simanneal/simanneal.js +231 -0
- package/dist/simanneal/simanneal.js.map +1 -0
- package/dist/sklearn/sklearn.d.ts +1272 -0
- package/dist/sklearn/sklearn.d.ts.map +1 -0
- package/dist/sklearn/sklearn.js +307 -0
- package/dist/sklearn/sklearn.js.map +1 -0
- package/dist/torch/torch.d.ts +658 -0
- package/dist/torch/torch.d.ts.map +1 -0
- package/dist/torch/torch.js +233 -0
- package/dist/torch/torch.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +80 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +81 -0
- package/dist/types.js.map +1 -0
- package/dist/xgboost/xgboost.d.ts +504 -0
- package/dist/xgboost/xgboost.d.ts.map +1 -0
- package/dist/xgboost/xgboost.js +177 -0
- package/dist/xgboost/xgboost.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,494 @@
|
|
|
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
|
+
* LightGBM platform functions for East.
|
|
7
|
+
*
|
|
8
|
+
* Provides fast gradient boosting for regression and classification.
|
|
9
|
+
* Uses cloudpickle for model serialization.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { StructType, VariantType, OptionType, IntegerType, FloatType, BlobType } from "@elaraai/east";
|
|
14
|
+
export { VectorType, MatrixType, LabelVectorType } from "../types.js";
|
|
15
|
+
/**
|
|
16
|
+
* Configuration for LightGBM models.
|
|
17
|
+
*/
|
|
18
|
+
export declare const LightGBMConfigType: StructType<{
|
|
19
|
+
/** Number of boosting rounds (default 100) */
|
|
20
|
+
n_estimators: OptionType<IntegerType>;
|
|
21
|
+
/** Maximum tree depth, -1 for unlimited (default -1) */
|
|
22
|
+
max_depth: OptionType<IntegerType>;
|
|
23
|
+
/** Learning rate / step size shrinkage (default 0.1) */
|
|
24
|
+
learning_rate: OptionType<FloatType>;
|
|
25
|
+
/** Maximum number of leaves in one tree (default 31) */
|
|
26
|
+
num_leaves: OptionType<IntegerType>;
|
|
27
|
+
/** Minimum number of samples required in a leaf (default 20) */
|
|
28
|
+
min_child_samples: OptionType<IntegerType>;
|
|
29
|
+
/** Subsample ratio of training instances (default 1.0) */
|
|
30
|
+
subsample: OptionType<FloatType>;
|
|
31
|
+
/** Subsample ratio of columns when constructing trees (default 1.0) */
|
|
32
|
+
colsample_bytree: OptionType<FloatType>;
|
|
33
|
+
/** L1 regularization term (default 0) */
|
|
34
|
+
reg_alpha: OptionType<FloatType>;
|
|
35
|
+
/** L2 regularization term (default 0) */
|
|
36
|
+
reg_lambda: OptionType<FloatType>;
|
|
37
|
+
/** Random seed for reproducibility */
|
|
38
|
+
random_state: OptionType<IntegerType>;
|
|
39
|
+
/** Number of parallel threads (default -1 for all cores) */
|
|
40
|
+
n_jobs: OptionType<IntegerType>;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Model blob type for serialized LightGBM models.
|
|
44
|
+
*
|
|
45
|
+
* Each model type has its own variant case containing cloudpickle bytes and metadata.
|
|
46
|
+
*/
|
|
47
|
+
export declare const LightGBMModelBlobType: VariantType<{
|
|
48
|
+
/** LightGBM regressor model */
|
|
49
|
+
lightgbm_regressor: StructType<{
|
|
50
|
+
/** Cloudpickle serialized model */
|
|
51
|
+
data: BlobType;
|
|
52
|
+
/** Number of input features */
|
|
53
|
+
n_features: IntegerType;
|
|
54
|
+
}>;
|
|
55
|
+
/** LightGBM classifier model */
|
|
56
|
+
lightgbm_classifier: StructType<{
|
|
57
|
+
/** Cloudpickle serialized model */
|
|
58
|
+
data: BlobType;
|
|
59
|
+
/** Number of input features */
|
|
60
|
+
n_features: IntegerType;
|
|
61
|
+
/** Number of classes */
|
|
62
|
+
n_classes: IntegerType;
|
|
63
|
+
}>;
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* Train a LightGBM regression model.
|
|
67
|
+
*
|
|
68
|
+
* @param X - Feature matrix
|
|
69
|
+
* @param y - Target vector
|
|
70
|
+
* @param config - LightGBM configuration
|
|
71
|
+
* @returns Model blob containing trained regressor
|
|
72
|
+
*/
|
|
73
|
+
export declare const lightgbm_train_regressor: import("@elaraai/east").PlatformDefinition<[import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>, import("@elaraai/east").ArrayType<FloatType>, StructType<{
|
|
74
|
+
/** Number of boosting rounds (default 100) */
|
|
75
|
+
n_estimators: OptionType<IntegerType>;
|
|
76
|
+
/** Maximum tree depth, -1 for unlimited (default -1) */
|
|
77
|
+
max_depth: OptionType<IntegerType>;
|
|
78
|
+
/** Learning rate / step size shrinkage (default 0.1) */
|
|
79
|
+
learning_rate: OptionType<FloatType>;
|
|
80
|
+
/** Maximum number of leaves in one tree (default 31) */
|
|
81
|
+
num_leaves: OptionType<IntegerType>;
|
|
82
|
+
/** Minimum number of samples required in a leaf (default 20) */
|
|
83
|
+
min_child_samples: OptionType<IntegerType>;
|
|
84
|
+
/** Subsample ratio of training instances (default 1.0) */
|
|
85
|
+
subsample: OptionType<FloatType>;
|
|
86
|
+
/** Subsample ratio of columns when constructing trees (default 1.0) */
|
|
87
|
+
colsample_bytree: OptionType<FloatType>;
|
|
88
|
+
/** L1 regularization term (default 0) */
|
|
89
|
+
reg_alpha: OptionType<FloatType>;
|
|
90
|
+
/** L2 regularization term (default 0) */
|
|
91
|
+
reg_lambda: OptionType<FloatType>;
|
|
92
|
+
/** Random seed for reproducibility */
|
|
93
|
+
random_state: OptionType<IntegerType>;
|
|
94
|
+
/** Number of parallel threads (default -1 for all cores) */
|
|
95
|
+
n_jobs: OptionType<IntegerType>;
|
|
96
|
+
}>], VariantType<{
|
|
97
|
+
/** LightGBM regressor model */
|
|
98
|
+
lightgbm_regressor: StructType<{
|
|
99
|
+
/** Cloudpickle serialized model */
|
|
100
|
+
data: BlobType;
|
|
101
|
+
/** Number of input features */
|
|
102
|
+
n_features: IntegerType;
|
|
103
|
+
}>;
|
|
104
|
+
/** LightGBM classifier model */
|
|
105
|
+
lightgbm_classifier: StructType<{
|
|
106
|
+
/** Cloudpickle serialized model */
|
|
107
|
+
data: BlobType;
|
|
108
|
+
/** Number of input features */
|
|
109
|
+
n_features: IntegerType;
|
|
110
|
+
/** Number of classes */
|
|
111
|
+
n_classes: IntegerType;
|
|
112
|
+
}>;
|
|
113
|
+
}>>;
|
|
114
|
+
/**
|
|
115
|
+
* Train a LightGBM classification model.
|
|
116
|
+
*
|
|
117
|
+
* @param X - Feature matrix
|
|
118
|
+
* @param y - Label vector (integer class labels)
|
|
119
|
+
* @param config - LightGBM configuration
|
|
120
|
+
* @returns Model blob containing trained classifier
|
|
121
|
+
*/
|
|
122
|
+
export declare const lightgbm_train_classifier: import("@elaraai/east").PlatformDefinition<[import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>, import("@elaraai/east").ArrayType<IntegerType>, StructType<{
|
|
123
|
+
/** Number of boosting rounds (default 100) */
|
|
124
|
+
n_estimators: OptionType<IntegerType>;
|
|
125
|
+
/** Maximum tree depth, -1 for unlimited (default -1) */
|
|
126
|
+
max_depth: OptionType<IntegerType>;
|
|
127
|
+
/** Learning rate / step size shrinkage (default 0.1) */
|
|
128
|
+
learning_rate: OptionType<FloatType>;
|
|
129
|
+
/** Maximum number of leaves in one tree (default 31) */
|
|
130
|
+
num_leaves: OptionType<IntegerType>;
|
|
131
|
+
/** Minimum number of samples required in a leaf (default 20) */
|
|
132
|
+
min_child_samples: OptionType<IntegerType>;
|
|
133
|
+
/** Subsample ratio of training instances (default 1.0) */
|
|
134
|
+
subsample: OptionType<FloatType>;
|
|
135
|
+
/** Subsample ratio of columns when constructing trees (default 1.0) */
|
|
136
|
+
colsample_bytree: OptionType<FloatType>;
|
|
137
|
+
/** L1 regularization term (default 0) */
|
|
138
|
+
reg_alpha: OptionType<FloatType>;
|
|
139
|
+
/** L2 regularization term (default 0) */
|
|
140
|
+
reg_lambda: OptionType<FloatType>;
|
|
141
|
+
/** Random seed for reproducibility */
|
|
142
|
+
random_state: OptionType<IntegerType>;
|
|
143
|
+
/** Number of parallel threads (default -1 for all cores) */
|
|
144
|
+
n_jobs: OptionType<IntegerType>;
|
|
145
|
+
}>], VariantType<{
|
|
146
|
+
/** LightGBM regressor model */
|
|
147
|
+
lightgbm_regressor: StructType<{
|
|
148
|
+
/** Cloudpickle serialized model */
|
|
149
|
+
data: BlobType;
|
|
150
|
+
/** Number of input features */
|
|
151
|
+
n_features: IntegerType;
|
|
152
|
+
}>;
|
|
153
|
+
/** LightGBM classifier model */
|
|
154
|
+
lightgbm_classifier: StructType<{
|
|
155
|
+
/** Cloudpickle serialized model */
|
|
156
|
+
data: BlobType;
|
|
157
|
+
/** Number of input features */
|
|
158
|
+
n_features: IntegerType;
|
|
159
|
+
/** Number of classes */
|
|
160
|
+
n_classes: IntegerType;
|
|
161
|
+
}>;
|
|
162
|
+
}>>;
|
|
163
|
+
/**
|
|
164
|
+
* Make predictions with a trained LightGBM regressor.
|
|
165
|
+
*
|
|
166
|
+
* @param model - Trained regressor model blob
|
|
167
|
+
* @param X - Feature matrix
|
|
168
|
+
* @returns Predicted values
|
|
169
|
+
*/
|
|
170
|
+
export declare const lightgbm_predict: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
171
|
+
/** LightGBM regressor model */
|
|
172
|
+
lightgbm_regressor: StructType<{
|
|
173
|
+
/** Cloudpickle serialized model */
|
|
174
|
+
data: BlobType;
|
|
175
|
+
/** Number of input features */
|
|
176
|
+
n_features: IntegerType;
|
|
177
|
+
}>;
|
|
178
|
+
/** LightGBM classifier model */
|
|
179
|
+
lightgbm_classifier: StructType<{
|
|
180
|
+
/** Cloudpickle serialized model */
|
|
181
|
+
data: BlobType;
|
|
182
|
+
/** Number of input features */
|
|
183
|
+
n_features: IntegerType;
|
|
184
|
+
/** Number of classes */
|
|
185
|
+
n_classes: IntegerType;
|
|
186
|
+
}>;
|
|
187
|
+
}>, import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>], import("@elaraai/east").ArrayType<FloatType>>;
|
|
188
|
+
/**
|
|
189
|
+
* Predict class labels with a trained LightGBM classifier.
|
|
190
|
+
*
|
|
191
|
+
* @param model - Trained classifier model blob
|
|
192
|
+
* @param X - Feature matrix
|
|
193
|
+
* @returns Predicted class labels
|
|
194
|
+
*/
|
|
195
|
+
export declare const lightgbm_predict_class: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
196
|
+
/** LightGBM regressor model */
|
|
197
|
+
lightgbm_regressor: StructType<{
|
|
198
|
+
/** Cloudpickle serialized model */
|
|
199
|
+
data: BlobType;
|
|
200
|
+
/** Number of input features */
|
|
201
|
+
n_features: IntegerType;
|
|
202
|
+
}>;
|
|
203
|
+
/** LightGBM classifier model */
|
|
204
|
+
lightgbm_classifier: StructType<{
|
|
205
|
+
/** Cloudpickle serialized model */
|
|
206
|
+
data: BlobType;
|
|
207
|
+
/** Number of input features */
|
|
208
|
+
n_features: IntegerType;
|
|
209
|
+
/** Number of classes */
|
|
210
|
+
n_classes: IntegerType;
|
|
211
|
+
}>;
|
|
212
|
+
}>, import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>], import("@elaraai/east").ArrayType<IntegerType>>;
|
|
213
|
+
/**
|
|
214
|
+
* Get class probabilities from a trained LightGBM classifier.
|
|
215
|
+
*
|
|
216
|
+
* @param model - Trained classifier model blob
|
|
217
|
+
* @param X - Feature matrix
|
|
218
|
+
* @returns Probability matrix (n_samples x n_classes)
|
|
219
|
+
*/
|
|
220
|
+
export declare const lightgbm_predict_proba: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
221
|
+
/** LightGBM regressor model */
|
|
222
|
+
lightgbm_regressor: StructType<{
|
|
223
|
+
/** Cloudpickle serialized model */
|
|
224
|
+
data: BlobType;
|
|
225
|
+
/** Number of input features */
|
|
226
|
+
n_features: IntegerType;
|
|
227
|
+
}>;
|
|
228
|
+
/** LightGBM classifier model */
|
|
229
|
+
lightgbm_classifier: StructType<{
|
|
230
|
+
/** Cloudpickle serialized model */
|
|
231
|
+
data: BlobType;
|
|
232
|
+
/** Number of input features */
|
|
233
|
+
n_features: IntegerType;
|
|
234
|
+
/** Number of classes */
|
|
235
|
+
n_classes: IntegerType;
|
|
236
|
+
}>;
|
|
237
|
+
}>, import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>], import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>>;
|
|
238
|
+
/**
|
|
239
|
+
* Type definitions for LightGBM functions.
|
|
240
|
+
*/
|
|
241
|
+
export declare const LightGBMTypes: {
|
|
242
|
+
/** Vector type (array of floats) */
|
|
243
|
+
readonly VectorType: import("@elaraai/east").ArrayType<FloatType>;
|
|
244
|
+
/** Matrix type (2D array of floats) */
|
|
245
|
+
readonly MatrixType: import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>;
|
|
246
|
+
/** Label vector type (array of integers) */
|
|
247
|
+
readonly LabelVectorType: import("@elaraai/east").ArrayType<IntegerType>;
|
|
248
|
+
/** LightGBM configuration type */
|
|
249
|
+
readonly LightGBMConfigType: StructType<{
|
|
250
|
+
/** Number of boosting rounds (default 100) */
|
|
251
|
+
n_estimators: OptionType<IntegerType>;
|
|
252
|
+
/** Maximum tree depth, -1 for unlimited (default -1) */
|
|
253
|
+
max_depth: OptionType<IntegerType>;
|
|
254
|
+
/** Learning rate / step size shrinkage (default 0.1) */
|
|
255
|
+
learning_rate: OptionType<FloatType>;
|
|
256
|
+
/** Maximum number of leaves in one tree (default 31) */
|
|
257
|
+
num_leaves: OptionType<IntegerType>;
|
|
258
|
+
/** Minimum number of samples required in a leaf (default 20) */
|
|
259
|
+
min_child_samples: OptionType<IntegerType>;
|
|
260
|
+
/** Subsample ratio of training instances (default 1.0) */
|
|
261
|
+
subsample: OptionType<FloatType>;
|
|
262
|
+
/** Subsample ratio of columns when constructing trees (default 1.0) */
|
|
263
|
+
colsample_bytree: OptionType<FloatType>;
|
|
264
|
+
/** L1 regularization term (default 0) */
|
|
265
|
+
reg_alpha: OptionType<FloatType>;
|
|
266
|
+
/** L2 regularization term (default 0) */
|
|
267
|
+
reg_lambda: OptionType<FloatType>;
|
|
268
|
+
/** Random seed for reproducibility */
|
|
269
|
+
random_state: OptionType<IntegerType>;
|
|
270
|
+
/** Number of parallel threads (default -1 for all cores) */
|
|
271
|
+
n_jobs: OptionType<IntegerType>;
|
|
272
|
+
}>;
|
|
273
|
+
/** Model blob type for LightGBM models */
|
|
274
|
+
readonly ModelBlobType: VariantType<{
|
|
275
|
+
/** LightGBM regressor model */
|
|
276
|
+
lightgbm_regressor: StructType<{
|
|
277
|
+
/** Cloudpickle serialized model */
|
|
278
|
+
data: BlobType;
|
|
279
|
+
/** Number of input features */
|
|
280
|
+
n_features: IntegerType;
|
|
281
|
+
}>;
|
|
282
|
+
/** LightGBM classifier model */
|
|
283
|
+
lightgbm_classifier: StructType<{
|
|
284
|
+
/** Cloudpickle serialized model */
|
|
285
|
+
data: BlobType;
|
|
286
|
+
/** Number of input features */
|
|
287
|
+
n_features: IntegerType;
|
|
288
|
+
/** Number of classes */
|
|
289
|
+
n_classes: IntegerType;
|
|
290
|
+
}>;
|
|
291
|
+
}>;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* LightGBM gradient boosting.
|
|
295
|
+
*
|
|
296
|
+
* Provides fast regression and classification with gradient boosted decision trees.
|
|
297
|
+
*/
|
|
298
|
+
export declare const LightGBM: {
|
|
299
|
+
/** Train LightGBM regressor */
|
|
300
|
+
readonly trainRegressor: import("@elaraai/east").PlatformDefinition<[import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>, import("@elaraai/east").ArrayType<FloatType>, StructType<{
|
|
301
|
+
/** Number of boosting rounds (default 100) */
|
|
302
|
+
n_estimators: OptionType<IntegerType>;
|
|
303
|
+
/** Maximum tree depth, -1 for unlimited (default -1) */
|
|
304
|
+
max_depth: OptionType<IntegerType>;
|
|
305
|
+
/** Learning rate / step size shrinkage (default 0.1) */
|
|
306
|
+
learning_rate: OptionType<FloatType>;
|
|
307
|
+
/** Maximum number of leaves in one tree (default 31) */
|
|
308
|
+
num_leaves: OptionType<IntegerType>;
|
|
309
|
+
/** Minimum number of samples required in a leaf (default 20) */
|
|
310
|
+
min_child_samples: OptionType<IntegerType>;
|
|
311
|
+
/** Subsample ratio of training instances (default 1.0) */
|
|
312
|
+
subsample: OptionType<FloatType>;
|
|
313
|
+
/** Subsample ratio of columns when constructing trees (default 1.0) */
|
|
314
|
+
colsample_bytree: OptionType<FloatType>;
|
|
315
|
+
/** L1 regularization term (default 0) */
|
|
316
|
+
reg_alpha: OptionType<FloatType>;
|
|
317
|
+
/** L2 regularization term (default 0) */
|
|
318
|
+
reg_lambda: OptionType<FloatType>;
|
|
319
|
+
/** Random seed for reproducibility */
|
|
320
|
+
random_state: OptionType<IntegerType>;
|
|
321
|
+
/** Number of parallel threads (default -1 for all cores) */
|
|
322
|
+
n_jobs: OptionType<IntegerType>;
|
|
323
|
+
}>], VariantType<{
|
|
324
|
+
/** LightGBM regressor model */
|
|
325
|
+
lightgbm_regressor: StructType<{
|
|
326
|
+
/** Cloudpickle serialized model */
|
|
327
|
+
data: BlobType;
|
|
328
|
+
/** Number of input features */
|
|
329
|
+
n_features: IntegerType;
|
|
330
|
+
}>;
|
|
331
|
+
/** LightGBM classifier model */
|
|
332
|
+
lightgbm_classifier: StructType<{
|
|
333
|
+
/** Cloudpickle serialized model */
|
|
334
|
+
data: BlobType;
|
|
335
|
+
/** Number of input features */
|
|
336
|
+
n_features: IntegerType;
|
|
337
|
+
/** Number of classes */
|
|
338
|
+
n_classes: IntegerType;
|
|
339
|
+
}>;
|
|
340
|
+
}>>;
|
|
341
|
+
/** Train LightGBM classifier */
|
|
342
|
+
readonly trainClassifier: import("@elaraai/east").PlatformDefinition<[import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>, import("@elaraai/east").ArrayType<IntegerType>, StructType<{
|
|
343
|
+
/** Number of boosting rounds (default 100) */
|
|
344
|
+
n_estimators: OptionType<IntegerType>;
|
|
345
|
+
/** Maximum tree depth, -1 for unlimited (default -1) */
|
|
346
|
+
max_depth: OptionType<IntegerType>;
|
|
347
|
+
/** Learning rate / step size shrinkage (default 0.1) */
|
|
348
|
+
learning_rate: OptionType<FloatType>;
|
|
349
|
+
/** Maximum number of leaves in one tree (default 31) */
|
|
350
|
+
num_leaves: OptionType<IntegerType>;
|
|
351
|
+
/** Minimum number of samples required in a leaf (default 20) */
|
|
352
|
+
min_child_samples: OptionType<IntegerType>;
|
|
353
|
+
/** Subsample ratio of training instances (default 1.0) */
|
|
354
|
+
subsample: OptionType<FloatType>;
|
|
355
|
+
/** Subsample ratio of columns when constructing trees (default 1.0) */
|
|
356
|
+
colsample_bytree: OptionType<FloatType>;
|
|
357
|
+
/** L1 regularization term (default 0) */
|
|
358
|
+
reg_alpha: OptionType<FloatType>;
|
|
359
|
+
/** L2 regularization term (default 0) */
|
|
360
|
+
reg_lambda: OptionType<FloatType>;
|
|
361
|
+
/** Random seed for reproducibility */
|
|
362
|
+
random_state: OptionType<IntegerType>;
|
|
363
|
+
/** Number of parallel threads (default -1 for all cores) */
|
|
364
|
+
n_jobs: OptionType<IntegerType>;
|
|
365
|
+
}>], VariantType<{
|
|
366
|
+
/** LightGBM regressor model */
|
|
367
|
+
lightgbm_regressor: StructType<{
|
|
368
|
+
/** Cloudpickle serialized model */
|
|
369
|
+
data: BlobType;
|
|
370
|
+
/** Number of input features */
|
|
371
|
+
n_features: IntegerType;
|
|
372
|
+
}>;
|
|
373
|
+
/** LightGBM classifier model */
|
|
374
|
+
lightgbm_classifier: StructType<{
|
|
375
|
+
/** Cloudpickle serialized model */
|
|
376
|
+
data: BlobType;
|
|
377
|
+
/** Number of input features */
|
|
378
|
+
n_features: IntegerType;
|
|
379
|
+
/** Number of classes */
|
|
380
|
+
n_classes: IntegerType;
|
|
381
|
+
}>;
|
|
382
|
+
}>>;
|
|
383
|
+
/** Make predictions with regressor */
|
|
384
|
+
readonly predict: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
385
|
+
/** LightGBM regressor model */
|
|
386
|
+
lightgbm_regressor: StructType<{
|
|
387
|
+
/** Cloudpickle serialized model */
|
|
388
|
+
data: BlobType;
|
|
389
|
+
/** Number of input features */
|
|
390
|
+
n_features: IntegerType;
|
|
391
|
+
}>;
|
|
392
|
+
/** LightGBM classifier model */
|
|
393
|
+
lightgbm_classifier: StructType<{
|
|
394
|
+
/** Cloudpickle serialized model */
|
|
395
|
+
data: BlobType;
|
|
396
|
+
/** Number of input features */
|
|
397
|
+
n_features: IntegerType;
|
|
398
|
+
/** Number of classes */
|
|
399
|
+
n_classes: IntegerType;
|
|
400
|
+
}>;
|
|
401
|
+
}>, import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>], import("@elaraai/east").ArrayType<FloatType>>;
|
|
402
|
+
/** Predict class labels with classifier */
|
|
403
|
+
readonly predictClass: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
404
|
+
/** LightGBM regressor model */
|
|
405
|
+
lightgbm_regressor: StructType<{
|
|
406
|
+
/** Cloudpickle serialized model */
|
|
407
|
+
data: BlobType;
|
|
408
|
+
/** Number of input features */
|
|
409
|
+
n_features: IntegerType;
|
|
410
|
+
}>;
|
|
411
|
+
/** LightGBM classifier model */
|
|
412
|
+
lightgbm_classifier: StructType<{
|
|
413
|
+
/** Cloudpickle serialized model */
|
|
414
|
+
data: BlobType;
|
|
415
|
+
/** Number of input features */
|
|
416
|
+
n_features: IntegerType;
|
|
417
|
+
/** Number of classes */
|
|
418
|
+
n_classes: IntegerType;
|
|
419
|
+
}>;
|
|
420
|
+
}>, import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>], import("@elaraai/east").ArrayType<IntegerType>>;
|
|
421
|
+
/** Get class probabilities from classifier */
|
|
422
|
+
readonly predictProba: import("@elaraai/east").PlatformDefinition<[VariantType<{
|
|
423
|
+
/** LightGBM regressor model */
|
|
424
|
+
lightgbm_regressor: StructType<{
|
|
425
|
+
/** Cloudpickle serialized model */
|
|
426
|
+
data: BlobType;
|
|
427
|
+
/** Number of input features */
|
|
428
|
+
n_features: IntegerType;
|
|
429
|
+
}>;
|
|
430
|
+
/** LightGBM classifier model */
|
|
431
|
+
lightgbm_classifier: StructType<{
|
|
432
|
+
/** Cloudpickle serialized model */
|
|
433
|
+
data: BlobType;
|
|
434
|
+
/** Number of input features */
|
|
435
|
+
n_features: IntegerType;
|
|
436
|
+
/** Number of classes */
|
|
437
|
+
n_classes: IntegerType;
|
|
438
|
+
}>;
|
|
439
|
+
}>, import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>], import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>>;
|
|
440
|
+
/** Type definitions */
|
|
441
|
+
readonly Types: {
|
|
442
|
+
/** Vector type (array of floats) */
|
|
443
|
+
readonly VectorType: import("@elaraai/east").ArrayType<FloatType>;
|
|
444
|
+
/** Matrix type (2D array of floats) */
|
|
445
|
+
readonly MatrixType: import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<FloatType>>;
|
|
446
|
+
/** Label vector type (array of integers) */
|
|
447
|
+
readonly LabelVectorType: import("@elaraai/east").ArrayType<IntegerType>;
|
|
448
|
+
/** LightGBM configuration type */
|
|
449
|
+
readonly LightGBMConfigType: StructType<{
|
|
450
|
+
/** Number of boosting rounds (default 100) */
|
|
451
|
+
n_estimators: OptionType<IntegerType>;
|
|
452
|
+
/** Maximum tree depth, -1 for unlimited (default -1) */
|
|
453
|
+
max_depth: OptionType<IntegerType>;
|
|
454
|
+
/** Learning rate / step size shrinkage (default 0.1) */
|
|
455
|
+
learning_rate: OptionType<FloatType>;
|
|
456
|
+
/** Maximum number of leaves in one tree (default 31) */
|
|
457
|
+
num_leaves: OptionType<IntegerType>;
|
|
458
|
+
/** Minimum number of samples required in a leaf (default 20) */
|
|
459
|
+
min_child_samples: OptionType<IntegerType>;
|
|
460
|
+
/** Subsample ratio of training instances (default 1.0) */
|
|
461
|
+
subsample: OptionType<FloatType>;
|
|
462
|
+
/** Subsample ratio of columns when constructing trees (default 1.0) */
|
|
463
|
+
colsample_bytree: OptionType<FloatType>;
|
|
464
|
+
/** L1 regularization term (default 0) */
|
|
465
|
+
reg_alpha: OptionType<FloatType>;
|
|
466
|
+
/** L2 regularization term (default 0) */
|
|
467
|
+
reg_lambda: OptionType<FloatType>;
|
|
468
|
+
/** Random seed for reproducibility */
|
|
469
|
+
random_state: OptionType<IntegerType>;
|
|
470
|
+
/** Number of parallel threads (default -1 for all cores) */
|
|
471
|
+
n_jobs: OptionType<IntegerType>;
|
|
472
|
+
}>;
|
|
473
|
+
/** Model blob type for LightGBM models */
|
|
474
|
+
readonly ModelBlobType: VariantType<{
|
|
475
|
+
/** LightGBM regressor model */
|
|
476
|
+
lightgbm_regressor: StructType<{
|
|
477
|
+
/** Cloudpickle serialized model */
|
|
478
|
+
data: BlobType;
|
|
479
|
+
/** Number of input features */
|
|
480
|
+
n_features: IntegerType;
|
|
481
|
+
}>;
|
|
482
|
+
/** LightGBM classifier model */
|
|
483
|
+
lightgbm_classifier: StructType<{
|
|
484
|
+
/** Cloudpickle serialized model */
|
|
485
|
+
data: BlobType;
|
|
486
|
+
/** Number of input features */
|
|
487
|
+
n_features: IntegerType;
|
|
488
|
+
/** Number of classes */
|
|
489
|
+
n_classes: IntegerType;
|
|
490
|
+
}>;
|
|
491
|
+
}>;
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
//# sourceMappingURL=lightgbm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lightgbm.d.ts","sourceRoot":"","sources":["../../src/lightgbm/lightgbm.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAEH,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACX,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,UAAU,EAAE,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AAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
* LightGBM platform functions for East.
|
|
7
|
+
*
|
|
8
|
+
* Provides fast gradient boosting for regression and classification.
|
|
9
|
+
* Uses cloudpickle for model serialization.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { East, StructType, VariantType, OptionType, IntegerType, FloatType, BlobType, } from "@elaraai/east";
|
|
14
|
+
import { VectorType, MatrixType, LabelVectorType } from "../types.js";
|
|
15
|
+
// Re-export shared types for convenience
|
|
16
|
+
export { VectorType, MatrixType, LabelVectorType } from "../types.js";
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// Config Types
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Configuration for LightGBM models.
|
|
22
|
+
*/
|
|
23
|
+
export const LightGBMConfigType = StructType({
|
|
24
|
+
/** Number of boosting rounds (default 100) */
|
|
25
|
+
n_estimators: OptionType(IntegerType),
|
|
26
|
+
/** Maximum tree depth, -1 for unlimited (default -1) */
|
|
27
|
+
max_depth: OptionType(IntegerType),
|
|
28
|
+
/** Learning rate / step size shrinkage (default 0.1) */
|
|
29
|
+
learning_rate: OptionType(FloatType),
|
|
30
|
+
/** Maximum number of leaves in one tree (default 31) */
|
|
31
|
+
num_leaves: OptionType(IntegerType),
|
|
32
|
+
/** Minimum number of samples required in a leaf (default 20) */
|
|
33
|
+
min_child_samples: OptionType(IntegerType),
|
|
34
|
+
/** Subsample ratio of training instances (default 1.0) */
|
|
35
|
+
subsample: OptionType(FloatType),
|
|
36
|
+
/** Subsample ratio of columns when constructing trees (default 1.0) */
|
|
37
|
+
colsample_bytree: OptionType(FloatType),
|
|
38
|
+
/** L1 regularization term (default 0) */
|
|
39
|
+
reg_alpha: OptionType(FloatType),
|
|
40
|
+
/** L2 regularization term (default 0) */
|
|
41
|
+
reg_lambda: OptionType(FloatType),
|
|
42
|
+
/** Random seed for reproducibility */
|
|
43
|
+
random_state: OptionType(IntegerType),
|
|
44
|
+
/** Number of parallel threads (default -1 for all cores) */
|
|
45
|
+
n_jobs: OptionType(IntegerType),
|
|
46
|
+
});
|
|
47
|
+
// ============================================================================
|
|
48
|
+
// Model Blob Types
|
|
49
|
+
// ============================================================================
|
|
50
|
+
/**
|
|
51
|
+
* Model blob type for serialized LightGBM models.
|
|
52
|
+
*
|
|
53
|
+
* Each model type has its own variant case containing cloudpickle bytes and metadata.
|
|
54
|
+
*/
|
|
55
|
+
export const LightGBMModelBlobType = VariantType({
|
|
56
|
+
/** LightGBM regressor model */
|
|
57
|
+
lightgbm_regressor: StructType({
|
|
58
|
+
/** Cloudpickle serialized model */
|
|
59
|
+
data: BlobType,
|
|
60
|
+
/** Number of input features */
|
|
61
|
+
n_features: IntegerType,
|
|
62
|
+
}),
|
|
63
|
+
/** LightGBM classifier model */
|
|
64
|
+
lightgbm_classifier: StructType({
|
|
65
|
+
/** Cloudpickle serialized model */
|
|
66
|
+
data: BlobType,
|
|
67
|
+
/** Number of input features */
|
|
68
|
+
n_features: IntegerType,
|
|
69
|
+
/** Number of classes */
|
|
70
|
+
n_classes: IntegerType,
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
// ============================================================================
|
|
74
|
+
// Platform Functions
|
|
75
|
+
// ============================================================================
|
|
76
|
+
/**
|
|
77
|
+
* Train a LightGBM regression model.
|
|
78
|
+
*
|
|
79
|
+
* @param X - Feature matrix
|
|
80
|
+
* @param y - Target vector
|
|
81
|
+
* @param config - LightGBM configuration
|
|
82
|
+
* @returns Model blob containing trained regressor
|
|
83
|
+
*/
|
|
84
|
+
export const lightgbm_train_regressor = East.platform("lightgbm_train_regressor", [MatrixType, VectorType, LightGBMConfigType], LightGBMModelBlobType);
|
|
85
|
+
/**
|
|
86
|
+
* Train a LightGBM classification model.
|
|
87
|
+
*
|
|
88
|
+
* @param X - Feature matrix
|
|
89
|
+
* @param y - Label vector (integer class labels)
|
|
90
|
+
* @param config - LightGBM configuration
|
|
91
|
+
* @returns Model blob containing trained classifier
|
|
92
|
+
*/
|
|
93
|
+
export const lightgbm_train_classifier = East.platform("lightgbm_train_classifier", [MatrixType, LabelVectorType, LightGBMConfigType], LightGBMModelBlobType);
|
|
94
|
+
/**
|
|
95
|
+
* Make predictions with a trained LightGBM regressor.
|
|
96
|
+
*
|
|
97
|
+
* @param model - Trained regressor model blob
|
|
98
|
+
* @param X - Feature matrix
|
|
99
|
+
* @returns Predicted values
|
|
100
|
+
*/
|
|
101
|
+
export const lightgbm_predict = East.platform("lightgbm_predict", [LightGBMModelBlobType, MatrixType], VectorType);
|
|
102
|
+
/**
|
|
103
|
+
* Predict class labels with a trained LightGBM classifier.
|
|
104
|
+
*
|
|
105
|
+
* @param model - Trained classifier model blob
|
|
106
|
+
* @param X - Feature matrix
|
|
107
|
+
* @returns Predicted class labels
|
|
108
|
+
*/
|
|
109
|
+
export const lightgbm_predict_class = East.platform("lightgbm_predict_class", [LightGBMModelBlobType, MatrixType], LabelVectorType);
|
|
110
|
+
/**
|
|
111
|
+
* Get class probabilities from a trained LightGBM classifier.
|
|
112
|
+
*
|
|
113
|
+
* @param model - Trained classifier model blob
|
|
114
|
+
* @param X - Feature matrix
|
|
115
|
+
* @returns Probability matrix (n_samples x n_classes)
|
|
116
|
+
*/
|
|
117
|
+
export const lightgbm_predict_proba = East.platform("lightgbm_predict_proba", [LightGBMModelBlobType, MatrixType], MatrixType);
|
|
118
|
+
// ============================================================================
|
|
119
|
+
// Grouped Export
|
|
120
|
+
// ============================================================================
|
|
121
|
+
/**
|
|
122
|
+
* Type definitions for LightGBM functions.
|
|
123
|
+
*/
|
|
124
|
+
export const LightGBMTypes = {
|
|
125
|
+
/** Vector type (array of floats) */
|
|
126
|
+
VectorType,
|
|
127
|
+
/** Matrix type (2D array of floats) */
|
|
128
|
+
MatrixType,
|
|
129
|
+
/** Label vector type (array of integers) */
|
|
130
|
+
LabelVectorType,
|
|
131
|
+
/** LightGBM configuration type */
|
|
132
|
+
LightGBMConfigType,
|
|
133
|
+
/** Model blob type for LightGBM models */
|
|
134
|
+
ModelBlobType: LightGBMModelBlobType,
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* LightGBM gradient boosting.
|
|
138
|
+
*
|
|
139
|
+
* Provides fast regression and classification with gradient boosted decision trees.
|
|
140
|
+
*/
|
|
141
|
+
export const LightGBM = {
|
|
142
|
+
/** Train LightGBM regressor */
|
|
143
|
+
trainRegressor: lightgbm_train_regressor,
|
|
144
|
+
/** Train LightGBM classifier */
|
|
145
|
+
trainClassifier: lightgbm_train_classifier,
|
|
146
|
+
/** Make predictions with regressor */
|
|
147
|
+
predict: lightgbm_predict,
|
|
148
|
+
/** Predict class labels with classifier */
|
|
149
|
+
predictClass: lightgbm_predict_class,
|
|
150
|
+
/** Get class probabilities from classifier */
|
|
151
|
+
predictProba: lightgbm_predict_proba,
|
|
152
|
+
/** Type definitions */
|
|
153
|
+
Types: LightGBMTypes,
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=lightgbm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lightgbm.js","sourceRoot":"","sources":["../../src/lightgbm/lightgbm.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EACH,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtE,yCAAyC;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtE,+EAA+E;AAC/E,eAAe;A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