autogluon.tabular 1.3.2b20250610__py3-none-any.whl → 1.4.1b20251214__py3-none-any.whl

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 (92) hide show
  1. autogluon/tabular/configs/config_helper.py +1 -1
  2. autogluon/tabular/configs/hyperparameter_configs.py +2 -265
  3. autogluon/tabular/configs/pipeline_presets.py +130 -0
  4. autogluon/tabular/configs/presets_configs.py +51 -26
  5. autogluon/tabular/configs/zeroshot/zeroshot_portfolio_2023.py +0 -1
  6. autogluon/tabular/configs/zeroshot/zeroshot_portfolio_2025.py +310 -0
  7. autogluon/tabular/models/__init__.py +6 -1
  8. autogluon/tabular/models/_utils/rapids_utils.py +1 -1
  9. autogluon/tabular/models/automm/automm_model.py +2 -0
  10. autogluon/tabular/models/automm/ft_transformer.py +4 -1
  11. autogluon/tabular/models/catboost/callbacks.py +3 -2
  12. autogluon/tabular/models/catboost/catboost_model.py +15 -9
  13. autogluon/tabular/models/catboost/catboost_utils.py +17 -3
  14. autogluon/tabular/models/ebm/__init__.py +0 -0
  15. autogluon/tabular/models/ebm/ebm_model.py +259 -0
  16. autogluon/tabular/models/ebm/hyperparameters/__init__.py +0 -0
  17. autogluon/tabular/models/ebm/hyperparameters/parameters.py +39 -0
  18. autogluon/tabular/models/ebm/hyperparameters/searchspaces.py +72 -0
  19. autogluon/tabular/models/fastainn/tabular_nn_fastai.py +7 -5
  20. autogluon/tabular/models/knn/knn_model.py +7 -3
  21. autogluon/tabular/models/lgb/lgb_model.py +60 -21
  22. autogluon/tabular/models/lr/lr_model.py +6 -1
  23. autogluon/tabular/models/lr/lr_preprocessing_utils.py +6 -7
  24. autogluon/tabular/models/lr/lr_rapids_model.py +45 -5
  25. autogluon/tabular/models/mitra/__init__.py +0 -0
  26. autogluon/tabular/models/mitra/_internal/__init__.py +1 -0
  27. autogluon/tabular/models/mitra/_internal/config/__init__.py +1 -0
  28. autogluon/tabular/models/mitra/_internal/config/config_pretrain.py +190 -0
  29. autogluon/tabular/models/mitra/_internal/config/config_run.py +32 -0
  30. autogluon/tabular/models/mitra/_internal/config/enums.py +162 -0
  31. autogluon/tabular/models/mitra/_internal/core/__init__.py +1 -0
  32. autogluon/tabular/models/mitra/_internal/core/callbacks.py +94 -0
  33. autogluon/tabular/models/mitra/_internal/core/get_loss.py +54 -0
  34. autogluon/tabular/models/mitra/_internal/core/get_optimizer.py +108 -0
  35. autogluon/tabular/models/mitra/_internal/core/get_scheduler.py +67 -0
  36. autogluon/tabular/models/mitra/_internal/core/prediction_metrics.py +132 -0
  37. autogluon/tabular/models/mitra/_internal/core/trainer_finetune.py +373 -0
  38. autogluon/tabular/models/mitra/_internal/data/__init__.py +1 -0
  39. autogluon/tabular/models/mitra/_internal/data/collator.py +46 -0
  40. autogluon/tabular/models/mitra/_internal/data/dataset_finetune.py +136 -0
  41. autogluon/tabular/models/mitra/_internal/data/dataset_split.py +57 -0
  42. autogluon/tabular/models/mitra/_internal/data/preprocessor.py +420 -0
  43. autogluon/tabular/models/mitra/_internal/models/__init__.py +1 -0
  44. autogluon/tabular/models/mitra/_internal/models/base.py +21 -0
  45. autogluon/tabular/models/mitra/_internal/models/embedding.py +182 -0
  46. autogluon/tabular/models/mitra/_internal/models/tab2d.py +667 -0
  47. autogluon/tabular/models/mitra/_internal/utils/__init__.py +1 -0
  48. autogluon/tabular/models/mitra/_internal/utils/set_seed.py +15 -0
  49. autogluon/tabular/models/mitra/mitra_model.py +380 -0
  50. autogluon/tabular/models/mitra/sklearn_interface.py +494 -0
  51. autogluon/tabular/models/realmlp/__init__.py +0 -0
  52. autogluon/tabular/models/realmlp/realmlp_model.py +360 -0
  53. autogluon/tabular/models/rf/rf_model.py +11 -6
  54. autogluon/tabular/models/tabicl/__init__.py +0 -0
  55. autogluon/tabular/models/tabicl/tabicl_model.py +179 -0
  56. autogluon/tabular/models/tabm/__init__.py +0 -0
  57. autogluon/tabular/models/tabm/_tabm_internal.py +545 -0
  58. autogluon/tabular/models/tabm/rtdl_num_embeddings.py +810 -0
  59. autogluon/tabular/models/tabm/tabm_model.py +356 -0
  60. autogluon/tabular/models/tabm/tabm_reference.py +631 -0
  61. autogluon/tabular/models/tabpfnmix/tabpfnmix_model.py +13 -7
  62. autogluon/tabular/models/tabpfnv2/__init__.py +0 -0
  63. autogluon/tabular/models/tabpfnv2/rfpfn/__init__.py +20 -0
  64. autogluon/tabular/models/tabpfnv2/rfpfn/configs.py +40 -0
  65. autogluon/tabular/models/tabpfnv2/rfpfn/scoring_utils.py +201 -0
  66. autogluon/tabular/models/tabpfnv2/rfpfn/sklearn_based_decision_tree_tabpfn.py +1464 -0
  67. autogluon/tabular/models/tabpfnv2/rfpfn/sklearn_based_random_forest_tabpfn.py +747 -0
  68. autogluon/tabular/models/tabpfnv2/rfpfn/sklearn_compat.py +863 -0
  69. autogluon/tabular/models/tabpfnv2/rfpfn/utils.py +106 -0
  70. autogluon/tabular/models/tabpfnv2/tabpfnv2_model.py +388 -0
  71. autogluon/tabular/models/tabular_nn/hyperparameters/parameters.py +1 -3
  72. autogluon/tabular/models/tabular_nn/torch/tabular_nn_torch.py +5 -5
  73. autogluon/tabular/models/xgboost/xgboost_model.py +10 -3
  74. autogluon/tabular/predictor/predictor.py +147 -84
  75. autogluon/tabular/registry/_ag_model_registry.py +12 -2
  76. autogluon/tabular/testing/fit_helper.py +57 -27
  77. autogluon/tabular/testing/generate_datasets.py +7 -0
  78. autogluon/tabular/trainer/abstract_trainer.py +3 -1
  79. autogluon/tabular/trainer/model_presets/presets.py +10 -1
  80. autogluon/tabular/version.py +1 -1
  81. autogluon.tabular-1.4.1b20251214-py3.11-nspkg.pth +1 -0
  82. {autogluon.tabular-1.3.2b20250610.dist-info → autogluon_tabular-1.4.1b20251214.dist-info}/METADATA +112 -57
  83. {autogluon.tabular-1.3.2b20250610.dist-info → autogluon_tabular-1.4.1b20251214.dist-info}/RECORD +89 -40
  84. {autogluon.tabular-1.3.2b20250610.dist-info → autogluon_tabular-1.4.1b20251214.dist-info}/WHEEL +1 -1
  85. autogluon/tabular/models/tabpfn/__init__.py +0 -1
  86. autogluon/tabular/models/tabpfn/tabpfn_model.py +0 -153
  87. autogluon.tabular-1.3.2b20250610-py3.9-nspkg.pth +0 -1
  88. {autogluon.tabular-1.3.2b20250610.dist-info → autogluon_tabular-1.4.1b20251214.dist-info/licenses}/LICENSE +0 -0
  89. {autogluon.tabular-1.3.2b20250610.dist-info → autogluon_tabular-1.4.1b20251214.dist-info/licenses}/NOTICE +0 -0
  90. {autogluon.tabular-1.3.2b20250610.dist-info → autogluon_tabular-1.4.1b20251214.dist-info}/namespace_packages.txt +0 -0
  91. {autogluon.tabular-1.3.2b20250610.dist-info → autogluon_tabular-1.4.1b20251214.dist-info}/top_level.txt +0 -0
  92. {autogluon.tabular-1.3.2b20250610.dist-info → autogluon_tabular-1.4.1b20251214.dist-info}/zip-safe +0 -0
@@ -326,7 +326,7 @@ class ConfigBuilder:
326
326
  """
327
327
  If True, only the best model and its ancestor models are saved in the outputted `predictor`. All other models are deleted.
328
328
  If you only care about deploying the most accurate predictor with the smallest file-size and no longer need any of the other trained models or functionality beyond prediction on new data, then set: `keep_only_best=True`, `save_space=True`.
329
- This is equivalent to calling `predictor.delete_models(models_to_keep='best', dry_run=False)` directly after `fit()`.
329
+ This is equivalent to calling `predictor.delete_models(models_to_keep='best')` directly after `fit()`.
330
330
  If used with `refit_full` and `set_best_to_refit_full`, the best model will be the refit_full model, and the original bagged best model will be deleted.
331
331
  `refit_full` will be automatically set to 'best' in this case to avoid training models which will be later deleted.
332
332
  """
@@ -1,6 +1,7 @@
1
1
  import copy
2
2
 
3
3
  from .zeroshot.zeroshot_portfolio_2023 import hyperparameter_portfolio_zeroshot_2023
4
+ from .zeroshot.zeroshot_portfolio_2025 import hyperparameter_portfolio_zeroshot_2025_small
4
5
 
5
6
  # Dictionary of preset hyperparameter configurations.
6
7
  hyperparameter_config_dict = dict(
@@ -31,10 +32,6 @@ hyperparameter_config_dict = dict(
31
32
  {"criterion": "entropy", "ag_args": {"name_suffix": "Entr", "problem_types": ["binary", "multiclass"]}},
32
33
  {"criterion": "squared_error", "ag_args": {"name_suffix": "MSE", "problem_types": ["regression", "quantile"]}},
33
34
  ],
34
- "KNN": [
35
- {"weights": "uniform", "ag_args": {"name_suffix": "Unif"}},
36
- {"weights": "distance", "ag_args": {"name_suffix": "Dist"}},
37
- ],
38
35
  },
39
36
  # Results in smaller models. Generally will make inference speed much faster and disk usage much lower, but with worse accuracy.
40
37
  light={
@@ -117,269 +114,9 @@ hyperparameter_config_dict = dict(
117
114
  # 'IM_BOOSTEDRULES': [{'n_estimators': 5}, {'n_estimators': 10}],
118
115
  # 'IM_HSTREE': [{'max_rules': 6}, {'max_rules': 12}, {'max_rules': 18}],
119
116
  },
120
- zeroshot_hpo={
121
- "XT": [{"min_samples_leaf": 1, "max_leaf_nodes": 15000, "max_features": 0.5, "ag_args": {"name_suffix": "_r19", "priority": 20}}],
122
- "RF": [{"min_samples_leaf": 5, "max_leaf_nodes": 50000, "max_features": 0.5, "ag_args": {"name_suffix": "_r5", "priority": 19}}],
123
- "GBM": [
124
- {
125
- "extra_trees": False,
126
- "feature_fraction": 0.7248284762542815,
127
- "learning_rate": 0.07947286942946127,
128
- "min_data_in_leaf": 50,
129
- "num_leaves": 89,
130
- "ag_args": {"name_suffix": "_r158", "priority": 18},
131
- },
132
- {
133
- "extra_trees": True,
134
- "feature_fraction": 0.7832570544199176,
135
- "learning_rate": 0.021720607471727896,
136
- "min_data_in_leaf": 3,
137
- "num_leaves": 21,
138
- "ag_args": {"name_suffix": "_r118", "priority": 17},
139
- },
140
- {
141
- "extra_trees": True,
142
- "feature_fraction": 0.7113010892989156,
143
- "learning_rate": 0.012535427424259274,
144
- "min_data_in_leaf": 16,
145
- "num_leaves": 48,
146
- "ag_args": {"name_suffix": "_r97", "priority": 16},
147
- },
148
- {
149
- "extra_trees": True,
150
- "feature_fraction": 0.45555769907110816,
151
- "learning_rate": 0.009591347321206594,
152
- "min_data_in_leaf": 50,
153
- "num_leaves": 110,
154
- "ag_args": {"name_suffix": "_r71", "priority": 15},
155
- },
156
- {
157
- "extra_trees": False,
158
- "feature_fraction": 0.40979710161022476,
159
- "learning_rate": 0.008708890211023034,
160
- "min_data_in_leaf": 3,
161
- "num_leaves": 80,
162
- "ag_args": {"name_suffix": "_r111", "priority": 14},
163
- },
164
- ],
165
- "FASTAI": [
166
- {
167
- "bs": 1024,
168
- "emb_drop": 0.6167722379778131,
169
- "epochs": 44,
170
- "layers": [200, 100, 50],
171
- "lr": 0.053440377855629266,
172
- "ps": 0.48477211305443607,
173
- "ag_args": {"name_suffix": "_r25", "priority": 13},
174
- },
175
- {
176
- "bs": 1024,
177
- "emb_drop": 0.6046989241462619,
178
- "epochs": 48,
179
- "layers": [200, 100, 50],
180
- "lr": 0.00775309042164966,
181
- "ps": 0.09244767444160731,
182
- "ag_args": {"name_suffix": "_r51", "priority": 12},
183
- },
184
- {
185
- "bs": 512,
186
- "emb_drop": 0.6557225316526186,
187
- "epochs": 49,
188
- "layers": [200, 100],
189
- "lr": 0.023627682025564638,
190
- "ps": 0.519566584552178,
191
- "ag_args": {"name_suffix": "_r82", "priority": 11},
192
- },
193
- {
194
- "bs": 2048,
195
- "emb_drop": 0.4066210919034579,
196
- "epochs": 43,
197
- "layers": [400, 200],
198
- "lr": 0.0029598312717673434,
199
- "ps": 0.4378695797438974,
200
- "ag_args": {"name_suffix": "_r121", "priority": 10},
201
- },
202
- {
203
- "bs": 128,
204
- "emb_drop": 0.44339037504795686,
205
- "epochs": 31,
206
- "layers": [400, 200, 100],
207
- "lr": 0.008615195908919904,
208
- "ps": 0.19220253419114286,
209
- "ag_args": {"name_suffix": "_r145", "priority": 9},
210
- },
211
- {
212
- "bs": 128,
213
- "emb_drop": 0.12106594798980945,
214
- "epochs": 38,
215
- "layers": [200, 100, 50],
216
- "lr": 0.037991970245029975,
217
- "ps": 0.33120008492595093,
218
- "ag_args": {"name_suffix": "_r173", "priority": 8},
219
- },
220
- {
221
- "bs": 128,
222
- "emb_drop": 0.4599138419358,
223
- "epochs": 47,
224
- "layers": [200, 100],
225
- "lr": 0.03888383281136287,
226
- "ps": 0.28193673177122863,
227
- "ag_args": {"name_suffix": "_r128", "priority": 7},
228
- },
229
- ],
230
- "CAT": [
231
- {"depth": 5, "l2_leaf_reg": 4.774992314058497, "learning_rate": 0.038551267822920274, "ag_args": {"name_suffix": "_r16", "priority": 6}},
232
- {"depth": 4, "l2_leaf_reg": 1.9950125740798321, "learning_rate": 0.028091050379971633, "ag_args": {"name_suffix": "_r42", "priority": 5}},
233
- {"depth": 6, "l2_leaf_reg": 1.8298803017644376, "learning_rate": 0.017844259810823604, "ag_args": {"name_suffix": "_r93", "priority": 4}},
234
- {"depth": 7, "l2_leaf_reg": 4.81099604606794, "learning_rate": 0.019085060180573103, "ag_args": {"name_suffix": "_r44", "priority": 3}},
235
- ],
236
- },
237
- zeroshot_hpo_hybrid={
238
- "NN_TORCH": {},
239
- "XT": [
240
- {"criterion": "gini", "ag_args": {"name_suffix": "Gini", "problem_types": ["binary", "multiclass"]}},
241
- {"criterion": "entropy", "ag_args": {"name_suffix": "Entr", "problem_types": ["binary", "multiclass"]}},
242
- {"criterion": "squared_error", "ag_args": {"name_suffix": "MSE", "problem_types": ["regression", "quantile"]}},
243
- {"min_samples_leaf": 1, "max_leaf_nodes": 15000, "max_features": 0.5, "ag_args": {"name_suffix": "_r19", "priority": 20}},
244
- ],
245
- "RF": [
246
- {"criterion": "gini", "ag_args": {"name_suffix": "Gini", "problem_types": ["binary", "multiclass"]}},
247
- {"criterion": "entropy", "ag_args": {"name_suffix": "Entr", "problem_types": ["binary", "multiclass"]}},
248
- {"criterion": "squared_error", "ag_args": {"name_suffix": "MSE", "problem_types": ["regression", "quantile"]}},
249
- {"min_samples_leaf": 5, "max_leaf_nodes": 50000, "max_features": 0.5, "ag_args": {"name_suffix": "_r5", "priority": 19}},
250
- ],
251
- "GBM": [
252
- {"extra_trees": True, "ag_args": {"name_suffix": "XT"}},
253
- {},
254
- {
255
- "learning_rate": 0.03,
256
- "num_leaves": 128,
257
- "feature_fraction": 0.9,
258
- "min_data_in_leaf": 3,
259
- "ag_args": {"name_suffix": "Large", "priority": 0, "hyperparameter_tune_kwargs": None},
260
- },
261
- {
262
- "extra_trees": False,
263
- "feature_fraction": 0.7248284762542815,
264
- "learning_rate": 0.07947286942946127,
265
- "min_data_in_leaf": 50,
266
- "num_leaves": 89,
267
- "ag_args": {"name_suffix": "_r158", "priority": 18},
268
- },
269
- {
270
- "extra_trees": True,
271
- "feature_fraction": 0.7832570544199176,
272
- "learning_rate": 0.021720607471727896,
273
- "min_data_in_leaf": 3,
274
- "num_leaves": 21,
275
- "ag_args": {"name_suffix": "_r118", "priority": 17},
276
- },
277
- {
278
- "extra_trees": True,
279
- "feature_fraction": 0.7113010892989156,
280
- "learning_rate": 0.012535427424259274,
281
- "min_data_in_leaf": 16,
282
- "num_leaves": 48,
283
- "ag_args": {"name_suffix": "_r97", "priority": 16},
284
- },
285
- {
286
- "extra_trees": True,
287
- "feature_fraction": 0.45555769907110816,
288
- "learning_rate": 0.009591347321206594,
289
- "min_data_in_leaf": 50,
290
- "num_leaves": 110,
291
- "ag_args": {"name_suffix": "_r71", "priority": 15},
292
- },
293
- {
294
- "extra_trees": False,
295
- "feature_fraction": 0.40979710161022476,
296
- "learning_rate": 0.008708890211023034,
297
- "min_data_in_leaf": 3,
298
- "num_leaves": 80,
299
- "ag_args": {"name_suffix": "_r111", "priority": 14},
300
- },
301
- ],
302
- "XGB": {},
303
- "FASTAI": [
304
- {},
305
- {
306
- "bs": 1024,
307
- "emb_drop": 0.6167722379778131,
308
- "epochs": 44,
309
- "layers": [200, 100, 50],
310
- "lr": 0.053440377855629266,
311
- "ps": 0.48477211305443607,
312
- "ag_args": {"name_suffix": "_r25", "priority": 13},
313
- },
314
- {
315
- "bs": 1024,
316
- "emb_drop": 0.6046989241462619,
317
- "epochs": 48,
318
- "layers": [200, 100, 50],
319
- "lr": 0.00775309042164966,
320
- "ps": 0.09244767444160731,
321
- "ag_args": {"name_suffix": "_r51", "priority": 12},
322
- },
323
- {
324
- "bs": 512,
325
- "emb_drop": 0.6557225316526186,
326
- "epochs": 49,
327
- "layers": [200, 100],
328
- "lr": 0.023627682025564638,
329
- "ps": 0.519566584552178,
330
- "ag_args": {"name_suffix": "_r82", "priority": 11},
331
- },
332
- {
333
- "bs": 2048,
334
- "emb_drop": 0.4066210919034579,
335
- "epochs": 43,
336
- "layers": [400, 200],
337
- "lr": 0.0029598312717673434,
338
- "ps": 0.4378695797438974,
339
- "ag_args": {"name_suffix": "_r121", "priority": 10},
340
- },
341
- {
342
- "bs": 128,
343
- "emb_drop": 0.44339037504795686,
344
- "epochs": 31,
345
- "layers": [400, 200, 100],
346
- "lr": 0.008615195908919904,
347
- "ps": 0.19220253419114286,
348
- "ag_args": {"name_suffix": "_r145", "priority": 9},
349
- },
350
- {
351
- "bs": 128,
352
- "emb_drop": 0.12106594798980945,
353
- "epochs": 38,
354
- "layers": [200, 100, 50],
355
- "lr": 0.037991970245029975,
356
- "ps": 0.33120008492595093,
357
- "ag_args": {"name_suffix": "_r173", "priority": 8},
358
- },
359
- {
360
- "bs": 128,
361
- "emb_drop": 0.4599138419358,
362
- "epochs": 47,
363
- "layers": [200, 100],
364
- "lr": 0.03888383281136287,
365
- "ps": 0.28193673177122863,
366
- "ag_args": {"name_suffix": "_r128", "priority": 7},
367
- },
368
- ],
369
- "CAT": [
370
- {},
371
- {"depth": 5, "l2_leaf_reg": 4.774992314058497, "learning_rate": 0.038551267822920274, "ag_args": {"name_suffix": "_r16", "priority": 6}},
372
- {"depth": 4, "l2_leaf_reg": 1.9950125740798321, "learning_rate": 0.028091050379971633, "ag_args": {"name_suffix": "_r42", "priority": 5}},
373
- {"depth": 6, "l2_leaf_reg": 1.8298803017644376, "learning_rate": 0.017844259810823604, "ag_args": {"name_suffix": "_r93", "priority": 4}},
374
- {"depth": 7, "l2_leaf_reg": 4.81099604606794, "learning_rate": 0.019085060180573103, "ag_args": {"name_suffix": "_r44", "priority": 3}},
375
- ],
376
- "KNN": [
377
- {"weights": "uniform", "ag_args": {"name_suffix": "Unif"}},
378
- {"weights": "distance", "ag_args": {"name_suffix": "Dist"}},
379
- ],
380
- },
381
117
  zeroshot=hyperparameter_portfolio_zeroshot_2023,
382
118
  zeroshot_2023=hyperparameter_portfolio_zeroshot_2023,
119
+ zeroshot_2025_tabfm=hyperparameter_portfolio_zeroshot_2025_small,
383
120
  )
384
121
 
385
122
  tabpfnmix_default = {
@@ -0,0 +1,130 @@
1
+ from __future__ import annotations
2
+
3
+ import math
4
+
5
+ from autogluon.core.constants import BINARY, PROBLEM_TYPES
6
+ from autogluon.core.utils.utils import default_holdout_frac
7
+
8
+ USE_BAG_HOLDOUT_AUTO_THRESHOLD = 1_000_000
9
+
10
+
11
+ def _get_validation_preset(num_train_rows: int, hpo_enabled: bool) -> dict[str, int | float]:
12
+ """Recommended validation preset manually defined by the AutoGluon developers."""
13
+
14
+ # -- Default recommendation
15
+ # max 8 due to 8 cores per CPU being very common.
16
+ # down to 5 folds for small datasets to have enough samples for a representative validation set.
17
+ num_bag_folds = min(8, max(5, math.floor(num_train_rows / 10)))
18
+
19
+ num_bag_sets = 1 # More repeats do not seem to help due to overfitting on val data.
20
+ use_bag_holdout = num_train_rows >= USE_BAG_HOLDOUT_AUTO_THRESHOLD
21
+ holdout_frac = round(default_holdout_frac(num_train_rows=num_train_rows, hyperparameter_tune=hpo_enabled), 4)
22
+
23
+ return dict(
24
+ num_bag_sets=num_bag_sets,
25
+ num_bag_folds=num_bag_folds,
26
+ use_bag_holdout=use_bag_holdout,
27
+ holdout_frac=holdout_frac,
28
+ )
29
+
30
+
31
+ # TODO(refactor): use a data class for the config of the validation method.
32
+ # TODO(improvement): Implement a more sophisticated solution.
33
+ # Could also use more metadata such as num_features, num_models,
34
+ # or time_limit for a heuristic.
35
+ # num_features: The number of features in the dataset.
36
+ # num_models: The number of models in the portfolio to fit.
37
+ # time_limit: The time limit for fitting models.
38
+ # Pointer for non-heuristic approach:
39
+ # -> meta-learning like Auto-Sklearn 2.0, needs a lot of metadata
40
+ def get_validation_and_stacking_method(
41
+ # Validation parameters
42
+ num_bag_folds: int | None,
43
+ num_bag_sets: int | None,
44
+ use_bag_holdout: bool | None,
45
+ holdout_frac: float | None,
46
+ # Stacking/Pipeline parameters
47
+ auto_stack: bool,
48
+ num_stack_levels: int | None,
49
+ dynamic_stacking: bool | None,
50
+ refit_full: bool | None,
51
+ # Metadata
52
+ num_train_rows: int,
53
+ problem_type: PROBLEM_TYPES,
54
+ hpo_enabled: bool,
55
+ ) -> tuple[int, int, int, bool, bool, float, bool]:
56
+ """Get the validation method for AutoGluon via a heuristic.
57
+
58
+ Input variables are `None` if they were not specified by the user or have an explicit default.
59
+
60
+ Parameters
61
+ ----------
62
+ num_bag_folds: int | None
63
+ The number of folds for cross-validation.
64
+ num_bag_sets: int | None
65
+ The number of repeats for cross-validation.
66
+ use_bag_holdout: bool | None
67
+ Whether to use (additional) holdout validation.
68
+ holdout_frac: float | None
69
+ The fraction of data to holdout for validation.
70
+ auto_stack: bool
71
+ Whether to automatically determine the stacking method.
72
+ num_stack_levels: int | None
73
+ The number of stacking levels.
74
+ dynamic_stacking: bool | None
75
+ Whether to use dynamic stacking.
76
+ refit_full: bool
77
+ Whether to refit the full training dataset.
78
+ num_train_rows: int
79
+ The number of rows in the training dataset.
80
+ problem_type: PROBLEM_TYPES
81
+ The type of problem to solve.
82
+ hpo_enabled: bool
83
+ If True, HPO is enabled during the run of AutoGluon.
84
+
85
+ Returns:
86
+ --------
87
+ Returns all variables needed to define the validation method.
88
+ """
89
+
90
+ cv_preset = _get_validation_preset(num_train_rows=num_train_rows, hpo_enabled=hpo_enabled)
91
+
92
+ # Independent of `auto_stack`
93
+ if use_bag_holdout is None:
94
+ use_bag_holdout = cv_preset["use_bag_holdout"]
95
+ if holdout_frac is None:
96
+ holdout_frac = cv_preset["holdout_frac"]
97
+ if dynamic_stacking is None:
98
+ dynamic_stacking = not use_bag_holdout
99
+ if refit_full is None:
100
+ refit_full = False
101
+
102
+ # Changed by `auto_stack`
103
+ if num_bag_folds is None:
104
+ # `num_bag_folds == 0` -> only use holdout validation
105
+ num_bag_folds = cv_preset["num_bag_folds"] if auto_stack else 0
106
+ if num_bag_sets is None:
107
+ # `num_bag_sets == 1` -> no repeats
108
+ num_bag_sets = cv_preset["num_bag_sets"] if auto_stack else 1
109
+ if num_stack_levels is None:
110
+ # Disable multi-layer stacking by default
111
+ num_stack_levels = 0
112
+
113
+ # Activate multi-layer stacking for `auto_stack` if
114
+ if auto_stack and (
115
+ dynamic_stacking # -> We use dynamic stacking
116
+ or
117
+ # -> We have holdout validation or a non-binary problem with more than 750 training rows
118
+ ((use_bag_holdout or (problem_type != BINARY)) and (num_train_rows >= 750))
119
+ ):
120
+ num_stack_levels = 1
121
+
122
+ return (
123
+ num_bag_folds,
124
+ num_bag_sets,
125
+ num_stack_levels,
126
+ dynamic_stacking,
127
+ use_bag_holdout,
128
+ holdout_frac,
129
+ refit_full,
130
+ )
@@ -1,32 +1,11 @@
1
1
  # Dictionary of preset fit() parameter configurations.
2
2
  tabular_presets_dict = dict(
3
- # [EXPERIMENTAL PRESET] The `experimental_quality` preset may be changed or removed without warning.
4
- # This preset acts as a testing ground for cutting edge features and models which could later be added to the `best_quality` preset in future releases.
5
- # Using this preset can lead to unexpected crashes, as it hasn't been as thoroughly tested as other presets.
6
- # Absolute best predictive accuracy with **zero** consideration to inference time or disk usage.
7
- # Recommended for applications that benefit from the best possible model accuracy and **do not** care about inference speed.
8
- # Significantly stronger than `best_quality`, but can be over 10x slower in inference.
9
- # Uses pre-trained tabular foundation models, which add a minimum of 1-2 GB to the predictor artifact's size.
10
- # For best results, use as large of an instance as possible with as many CPU cores as possible (ideally 64+ cores)
11
- # DOES NOT SUPPORT GPU.
12
- # Aliases: experimental
13
- experimental_quality={
14
- "auto_stack": True,
15
- "dynamic_stacking": "auto",
16
- "num_bag_sets": 1,
17
- "hyperparameters": "experimental",
18
- "fit_strategy": "parallel",
19
- "num_gpus": 0,
20
- "time_limit": 3600,
21
- },
22
-
23
3
  # Best predictive accuracy with little consideration to inference time or disk usage. Achieve even better results by specifying a large time_limit value.
24
4
  # Recommended for applications that benefit from the best possible model accuracy.
25
5
  # Aliases: best
26
6
  best_quality={
27
7
  "auto_stack": True,
28
8
  "dynamic_stacking": "auto",
29
- "num_bag_sets": 1,
30
9
  "hyperparameters": "zeroshot",
31
10
  "time_limit": 3600,
32
11
  },
@@ -36,7 +15,6 @@ tabular_presets_dict = dict(
36
15
  high_quality={
37
16
  "auto_stack": True,
38
17
  "dynamic_stacking": "auto",
39
- "num_bag_sets": 1,
40
18
  "hyperparameters": "zeroshot",
41
19
  "time_limit": 3600,
42
20
  "refit_full": True,
@@ -49,7 +27,6 @@ tabular_presets_dict = dict(
49
27
  good_quality={
50
28
  "auto_stack": True,
51
29
  "dynamic_stacking": "auto",
52
- "num_bag_sets": 1,
53
30
  "hyperparameters": "light",
54
31
  "time_limit": 3600,
55
32
  "refit_full": True,
@@ -94,7 +71,52 @@ tabular_presets_dict = dict(
94
71
  # ------------------------------------------
95
72
  # Experimental presets. Only use these presets if you are ok with unstable and potentially poor performing presets.
96
73
  # Experimental presets can be removed or changed without warning.
97
- # No Experimental Presets in v1.0
74
+
75
+ # [EXPERIMENTAL PRESET] The `extreme` preset may be changed or removed without warning.
76
+ # This preset acts as a testing ground for cutting edge features and models which could later be added to the `best_quality` preset in future releases.
77
+ # Using this preset can lead to unexpected crashes, as it hasn't been as thoroughly tested as other presets.
78
+ # Absolute best predictive accuracy with **zero** consideration to inference time or disk usage.
79
+ # Recommended for applications that benefit from the best possible model accuracy and **do not** care about inference speed.
80
+ # Significantly stronger than `best_quality`, but can be over 10x slower in inference.
81
+ # Uses pre-trained tabular foundation models, which add a minimum of 1-2 GB to the predictor artifact's size.
82
+ # For best results, use as large of an instance as possible with a GPU and as many CPU cores as possible (ideally 64+ cores)
83
+ # Aliases: extreme, experimental, experimental_quality
84
+ # GPU STRONGLY RECOMMENDED
85
+ extreme_quality={
86
+ "auto_stack": True,
87
+ "dynamic_stacking": "auto",
88
+ "num_bag_sets": 1,
89
+ "_experimental_dynamic_hyperparameters": True,
90
+ "hyperparameters": None,
91
+ "time_limit": 3600,
92
+ },
93
+
94
+ # Preset with a portfolio learned from TabArena v0.1: https://tabarena.ai/
95
+ # Uses tabular foundation models: TabPFNv2, TabICL, Mitra
96
+ # Uses deep learning model: TabM
97
+ # Uses tree models: LightGBM, CatBoost, XGBoost
98
+ # Extremely powerful on small datasets with <= 10000 training samples.
99
+ # Requires a GPU for best results.
100
+ tabarena={
101
+ "auto_stack": True,
102
+ "dynamic_stacking": "auto",
103
+ "num_bag_sets": 1,
104
+ "num_stack_levels": 0,
105
+ "hyperparameters": "zeroshot_2025_tabfm",
106
+ "time_limit": 3600,
107
+ },
108
+
109
+ # DOES NOT SUPPORT GPU.
110
+ experimental_quality_v120={
111
+ "auto_stack": True,
112
+ "dynamic_stacking": "auto",
113
+ "num_bag_sets": 1,
114
+ "hyperparameters": "experimental",
115
+ "fit_strategy": "parallel",
116
+ "num_gpus": 0,
117
+ "time_limit": 3600,
118
+ },
119
+
98
120
  # ------------------------------------------
99
121
  # ------------------------------------------
100
122
  # ------------------------------------------
@@ -103,7 +125,7 @@ tabular_presets_dict = dict(
103
125
 
104
126
  # Alias preset name alternatives
105
127
  tabular_presets_alias = dict(
106
- experimental="experimental_quality",
128
+ extreme="extreme_quality",
107
129
  best="best_quality",
108
130
  high="high_quality",
109
131
  high_quality_fast_inference_only_refit="high_quality",
@@ -111,9 +133,12 @@ tabular_presets_alias = dict(
111
133
  good_quality_faster_inference_only_refit="good_quality",
112
134
  medium="medium_quality",
113
135
  medium_quality_faster_train="medium_quality",
114
- eq="experimental_quality",
136
+ eq="extreme_quality",
115
137
  bq="best_quality",
116
138
  hq="high_quality",
117
139
  gq="good_quality",
118
140
  mq="medium_quality",
141
+ experimental="extreme_quality",
142
+ experimental_quality="extreme_quality",
143
+ experimental_quality_v140="extreme_quality",
119
144
  )
@@ -793,5 +793,4 @@ hyperparameter_portfolio_zeroshot_2023 = {
793
793
  {"max_features": 1.0, "max_leaf_nodes": 40459, "min_samples_leaf": 1, "ag_args": {"name_suffix": "_r197", "priority": -78}},
794
794
  {"max_features": "sqrt", "max_leaf_nodes": 29702, "min_samples_leaf": 2, "ag_args": {"name_suffix": "_r126", "priority": -86}},
795
795
  ],
796
- "KNN": [{"weights": "uniform", "ag_args": {"name_suffix": "Unif"}}, {"weights": "distance", "ag_args": {"name_suffix": "Dist"}}],
797
796
  }