@elaraai/east-py-datascience 0.0.2-beta.9 → 1.0.0

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 (126) hide show
  1. package/CLA.md +26 -0
  2. package/CONTRIBUTING.md +28 -0
  3. package/LICENSE.md +2 -2
  4. package/README.md +108 -15
  5. package/dist/src/alns/alns.d.ts +528 -0
  6. package/dist/src/alns/alns.d.ts.map +1 -0
  7. package/dist/src/alns/alns.js +238 -0
  8. package/dist/src/alns/alns.js.map +1 -0
  9. package/dist/src/google_or/google_or.d.ts +2457 -0
  10. package/dist/src/google_or/google_or.d.ts.map +1 -0
  11. package/dist/src/google_or/google_or.js +547 -0
  12. package/dist/src/google_or/google_or.js.map +1 -0
  13. package/dist/{gp → src/gp}/gp.d.ts +185 -136
  14. package/dist/src/gp/gp.d.ts.map +1 -0
  15. package/dist/{gp → src/gp}/gp.js +64 -12
  16. package/dist/src/gp/gp.js.map +1 -0
  17. package/dist/src/index.d.ts +34 -0
  18. package/dist/src/index.d.ts.map +1 -0
  19. package/dist/src/index.js +57 -0
  20. package/dist/src/index.js.map +1 -0
  21. package/dist/src/lightgbm/lightgbm.d.ts +575 -0
  22. package/dist/src/lightgbm/lightgbm.d.ts.map +1 -0
  23. package/dist/{lightgbm → src/lightgbm}/lightgbm.js +104 -18
  24. package/dist/src/lightgbm/lightgbm.js.map +1 -0
  25. package/dist/src/lightning/lightning.d.ts +1594 -0
  26. package/dist/src/lightning/lightning.d.ts.map +1 -0
  27. package/dist/src/lightning/lightning.js +468 -0
  28. package/dist/src/lightning/lightning.js.map +1 -0
  29. package/dist/{mads → src/mads}/mads.d.ts +109 -112
  30. package/dist/src/mads/mads.d.ts.map +1 -0
  31. package/dist/{mads → src/mads}/mads.js +6 -8
  32. package/dist/src/mads/mads.js.map +1 -0
  33. package/dist/src/mapie/mapie.d.ts +3680 -0
  34. package/dist/src/mapie/mapie.d.ts.map +1 -0
  35. package/dist/src/mapie/mapie.js +616 -0
  36. package/dist/src/mapie/mapie.js.map +1 -0
  37. package/dist/{ngboost → src/ngboost}/ngboost.d.ts +192 -142
  38. package/dist/src/ngboost/ngboost.d.ts.map +1 -0
  39. package/dist/{ngboost → src/ngboost}/ngboost.js +67 -14
  40. package/dist/src/ngboost/ngboost.js.map +1 -0
  41. package/dist/src/optimization/optimization.d.ts +700 -0
  42. package/dist/src/optimization/optimization.d.ts.map +1 -0
  43. package/dist/src/optimization/optimization.js +411 -0
  44. package/dist/src/optimization/optimization.js.map +1 -0
  45. package/dist/{optuna → src/optuna}/optuna.d.ts +374 -314
  46. package/dist/src/optuna/optuna.d.ts.map +1 -0
  47. package/dist/{optuna → src/optuna}/optuna.js +2 -0
  48. package/dist/src/optuna/optuna.js.map +1 -0
  49. package/dist/src/pymc/pymc.d.ts +2932 -0
  50. package/dist/src/pymc/pymc.d.ts.map +1 -0
  51. package/dist/src/pymc/pymc.js +688 -0
  52. package/dist/src/pymc/pymc.js.map +1 -0
  53. package/dist/src/scipy/scipy.d.ts +2205 -0
  54. package/dist/src/scipy/scipy.d.ts.map +1 -0
  55. package/dist/src/scipy/scipy.js +884 -0
  56. package/dist/src/scipy/scipy.js.map +1 -0
  57. package/dist/src/shap/shap.d.ts +4611 -0
  58. package/dist/src/shap/shap.d.ts.map +1 -0
  59. package/dist/src/shap/shap.js +552 -0
  60. package/dist/src/shap/shap.js.map +1 -0
  61. package/dist/{simanneal → src/simanneal}/simanneal.d.ts +257 -160
  62. package/dist/src/simanneal/simanneal.d.ts.map +1 -0
  63. package/dist/{simanneal → src/simanneal}/simanneal.js +105 -8
  64. package/dist/src/simanneal/simanneal.js.map +1 -0
  65. package/dist/src/simulation/simulation.d.ts +224 -0
  66. package/dist/src/simulation/simulation.d.ts.map +1 -0
  67. package/dist/src/simulation/simulation.js +189 -0
  68. package/dist/src/simulation/simulation.js.map +1 -0
  69. package/dist/src/sklearn/sklearn.d.ts +6362 -0
  70. package/dist/src/sklearn/sklearn.d.ts.map +1 -0
  71. package/dist/src/sklearn/sklearn.js +1508 -0
  72. package/dist/src/sklearn/sklearn.js.map +1 -0
  73. package/dist/src/torch/torch.d.ts +1205 -0
  74. package/dist/src/torch/torch.d.ts.map +1 -0
  75. package/dist/{torch → src/torch}/torch.js +109 -18
  76. package/dist/src/torch/torch.js.map +1 -0
  77. package/dist/src/types.d.ts +43 -0
  78. package/dist/src/types.d.ts.map +1 -0
  79. package/dist/src/types.js +44 -0
  80. package/dist/src/types.js.map +1 -0
  81. package/dist/src/xgboost/xgboost.d.ts +1424 -0
  82. package/dist/src/xgboost/xgboost.d.ts.map +1 -0
  83. package/dist/src/xgboost/xgboost.js +432 -0
  84. package/dist/src/xgboost/xgboost.js.map +1 -0
  85. package/package.json +21 -42
  86. package/dist/gp/gp.d.ts.map +0 -1
  87. package/dist/gp/gp.js.map +0 -1
  88. package/dist/index.d.ts +0 -27
  89. package/dist/index.d.ts.map +0 -1
  90. package/dist/index.js +0 -41
  91. package/dist/index.js.map +0 -1
  92. package/dist/lightgbm/lightgbm.d.ts +0 -494
  93. package/dist/lightgbm/lightgbm.d.ts.map +0 -1
  94. package/dist/lightgbm/lightgbm.js.map +0 -1
  95. package/dist/mads/mads.d.ts.map +0 -1
  96. package/dist/mads/mads.js.map +0 -1
  97. package/dist/ngboost/ngboost.d.ts.map +0 -1
  98. package/dist/ngboost/ngboost.js.map +0 -1
  99. package/dist/optuna/optuna.d.ts.map +0 -1
  100. package/dist/optuna/optuna.js.map +0 -1
  101. package/dist/scipy/scipy.d.ts +0 -1260
  102. package/dist/scipy/scipy.d.ts.map +0 -1
  103. package/dist/scipy/scipy.js +0 -413
  104. package/dist/scipy/scipy.js.map +0 -1
  105. package/dist/shap/shap.d.ts +0 -657
  106. package/dist/shap/shap.d.ts.map +0 -1
  107. package/dist/shap/shap.js +0 -241
  108. package/dist/shap/shap.js.map +0 -1
  109. package/dist/simanneal/simanneal.d.ts.map +0 -1
  110. package/dist/simanneal/simanneal.js.map +0 -1
  111. package/dist/sklearn/sklearn.d.ts +0 -2691
  112. package/dist/sklearn/sklearn.d.ts.map +0 -1
  113. package/dist/sklearn/sklearn.js +0 -524
  114. package/dist/sklearn/sklearn.js.map +0 -1
  115. package/dist/torch/torch.d.ts +0 -1081
  116. package/dist/torch/torch.d.ts.map +0 -1
  117. package/dist/torch/torch.js.map +0 -1
  118. package/dist/tsconfig.tsbuildinfo +0 -1
  119. package/dist/types.d.ts +0 -80
  120. package/dist/types.d.ts.map +0 -1
  121. package/dist/types.js +0 -81
  122. package/dist/types.js.map +0 -1
  123. package/dist/xgboost/xgboost.d.ts +0 -504
  124. package/dist/xgboost/xgboost.d.ts.map +0 -1
  125. package/dist/xgboost/xgboost.js +0 -177
  126. package/dist/xgboost/xgboost.js.map +0 -1
@@ -62,13 +62,13 @@ export const NGBoostPredictConfigType = StructType({
62
62
  */
63
63
  export const NGBoostPredictResultType = StructType({
64
64
  /** Point predictions (mean) */
65
- predictions: VectorType,
65
+ predictions: VectorType(FloatType),
66
66
  /** Standard deviation */
67
- std: OptionType(VectorType),
67
+ std: OptionType(VectorType(FloatType)),
68
68
  /** Lower confidence interval */
69
- lower: OptionType(VectorType),
69
+ lower: OptionType(VectorType(FloatType)),
70
70
  /** Upper confidence interval */
71
- upper: OptionType(VectorType),
71
+ upper: OptionType(VectorType(FloatType)),
72
72
  });
73
73
  // ============================================================================
74
74
  // Model Blob Types
@@ -98,7 +98,7 @@ export const NGBoostModelBlobType = VariantType({
98
98
  * @param config - NGBoost configuration
99
99
  * @returns Model blob containing trained regressor
100
100
  */
101
- export const ngboost_train_regressor = East.platform("ngboost_train_regressor", [MatrixType, VectorType, NGBoostConfigType], NGBoostModelBlobType);
101
+ export const ngboost_train_regressor = East.platform("ngboost_train_regressor", [MatrixType(FloatType), VectorType(FloatType), NGBoostConfigType], NGBoostModelBlobType);
102
102
  /**
103
103
  * Make point predictions (mean) with a trained NGBoost regressor.
104
104
  *
@@ -106,7 +106,7 @@ export const ngboost_train_regressor = East.platform("ngboost_train_regressor",
106
106
  * @param X - Feature matrix
107
107
  * @returns Predicted values (mean of predictive distribution)
108
108
  */
109
- export const ngboost_predict = East.platform("ngboost_predict", [NGBoostModelBlobType, MatrixType], VectorType);
109
+ export const ngboost_predict = East.platform("ngboost_predict", [NGBoostModelBlobType, MatrixType(FloatType)], VectorType(FloatType));
110
110
  /**
111
111
  * Get predictions with full uncertainty from NGBoost regressor.
112
112
  *
@@ -117,7 +117,7 @@ export const ngboost_predict = East.platform("ngboost_predict", [NGBoostModelBlo
117
117
  * @param config - Prediction configuration (confidence level)
118
118
  * @returns Predictions with uncertainty estimates
119
119
  */
120
- export const ngboost_predict_dist = East.platform("ngboost_predict_dist", [NGBoostModelBlobType, MatrixType, NGBoostPredictConfigType], NGBoostPredictResultType);
120
+ export const ngboost_predict_dist = East.platform("ngboost_predict_dist", [NGBoostModelBlobType, MatrixType(FloatType), NGBoostPredictConfigType], NGBoostPredictResultType);
121
121
  // ============================================================================
122
122
  // Grouped Export
123
123
  // ============================================================================
@@ -125,10 +125,6 @@ export const ngboost_predict_dist = East.platform("ngboost_predict_dist", [NGBoo
125
125
  * Type definitions for NGBoost functions.
126
126
  */
127
127
  export const NGBoostTypes = {
128
- /** Vector type (array of floats) */
129
- VectorType,
130
- /** Matrix type (2D array of floats) */
131
- MatrixType,
132
128
  /** Distribution type for NGBoost */
133
129
  NGBoostDistributionType,
134
130
  /** NGBoost configuration type */
@@ -166,11 +162,68 @@ export const NGBoostTypes = {
166
162
  * ```
167
163
  */
168
164
  export const NGBoost = {
169
- /** Train NGBoost regressor */
165
+ /**
166
+ * Train an NGBoost regression model with probabilistic output.
167
+ *
168
+ * @example
169
+ * ```ts
170
+ * import { East, FloatType, MatrixType, VectorType, variant } from "@elaraai/east";
171
+ * import { NGBoost, NGBoostConfigType } from "@elaraai/east-py-datascience";
172
+ *
173
+ * const train = East.function([], NGBoost.Types.ModelBlobType, ($) => {
174
+ * const X = $.let([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]);
175
+ * const y = $.let(new Float64Array([1.0, 2.0, 3.0, 4.0]));
176
+ * const config = $.let({
177
+ * n_estimators: variant("some", 100n), learning_rate: variant("some", 0.01),
178
+ * minibatch_frac: variant("none", null), col_sample: variant("none", null),
179
+ * random_state: variant("some", 42n), distribution: variant("none", null),
180
+ * }, NGBoostConfigType);
181
+ * return $.return(NGBoost.trainRegressor(X, y, config));
182
+ * });
183
+ * ```
184
+ */
170
185
  trainRegressor: ngboost_train_regressor,
171
- /** Make point predictions with regressor */
186
+ /**
187
+ * Make point predictions with a trained NGBoost regressor.
188
+ *
189
+ * @example
190
+ * ```ts
191
+ * import { East, FloatType, MatrixType, VectorType } from "@elaraai/east";
192
+ * import { NGBoost } from "@elaraai/east-py-datascience";
193
+ *
194
+ * const predictFn = East.function(
195
+ * [NGBoost.Types.ModelBlobType, MatrixType(FloatType)],
196
+ * VectorType(FloatType),
197
+ * ($, model, X) => {
198
+ * return $.return(NGBoost.predict(model, X));
199
+ * }
200
+ * );
201
+ * ```
202
+ */
172
203
  predict: ngboost_predict,
173
- /** Get predictions with uncertainty */
204
+ /**
205
+ * Get predictions with uncertainty estimates (confidence intervals, std).
206
+ *
207
+ * @example
208
+ * ```ts
209
+ * import { East, FloatType, MatrixType, variant } from "@elaraai/east";
210
+ * import { NGBoost, NGBoostPredictConfigType } from "@elaraai/east-py-datascience";
211
+ *
212
+ * const predictFn = East.function(
213
+ * [NGBoost.Types.ModelBlobType, MatrixType(FloatType)],
214
+ * NGBoost.Types.NGBoostPredictResultType,
215
+ * ($, model, X) => {
216
+ * const config = $.let({
217
+ * confidence_level: variant("some", 0.95),
218
+ * }, NGBoostPredictConfigType);
219
+ * const result = $.let(NGBoost.predictDist(model, X, config));
220
+ * // result.predictions => point predictions
221
+ * // result.lower, result.upper => confidence interval
222
+ * return $.return(result);
223
+ * }
224
+ * );
225
+ * ```
226
+ */
174
227
  predictDist: ngboost_predict_dist,
175
228
  /** Type definitions */
176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