autogluon.core 1.2.1b20250211__py3-none-any.whl → 1.2.1b20250212__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.
@@ -823,8 +823,8 @@ class AbstractModel:
823
823
  self._fit_metadata = self._compute_fit_metadata(**kwargs)
824
824
  self._is_fit_metadata_registered = True
825
825
 
826
- def _compute_fit_metadata(self, X_val: pd.DataFrame = None, X_unlabeled: pd.DataFrame = None, num_cpus: int = None, num_gpus: int = None, **kwargs) -> dict:
827
- fit_metadata = dict(val_in_fit=X_val is not None, unlabeled_in_fit=X_unlabeled is not None, num_cpus=num_cpus, num_gpus=num_gpus)
826
+ def _compute_fit_metadata(self, X: pd.DataFrame = None, X_val: pd.DataFrame = None, X_unlabeled: pd.DataFrame = None, num_cpus: int = None, num_gpus: int = None, **kwargs) -> dict:
827
+ fit_metadata = dict(num_samples=len(X) if X is not None else None, val_in_fit=X_val is not None, unlabeled_in_fit=X_unlabeled is not None, num_cpus=num_cpus, num_gpus=num_gpus)
828
828
  return fit_metadata
829
829
 
830
830
  def get_fit_metadata(self) -> dict:
@@ -240,6 +240,66 @@ class BaggedEnsembleModel(AbstractModel):
240
240
  _skip_oof: bool = False,
241
241
  **kwargs,
242
242
  ):
243
+ """
244
+
245
+ Parameters
246
+ ----------
247
+ X : pd.DataFrame
248
+ The training data features.
249
+ y : pd.Series
250
+ The training data ground truth labels.
251
+ X_val : pd.DataFrame, default None
252
+ The validation data features.
253
+ Ignored by BaggedEnsembleModel.
254
+ y_val : pd.Series, default None
255
+ The validation data ground truth labels.
256
+ Ignored by BaggedEnsembleModel.
257
+ X_pseudo : pd.DataFrame, default None
258
+ Pseudo data features.
259
+ If specified, this data is added to each fold model's training data.
260
+ y_pseudo : pd.Series, default None
261
+ Pseudo data ground truth labels.
262
+ If specified, this data is added to each fold model's training data.
263
+ k_fold : int | None, default None
264
+ If int, must be a value >=1. Passing 0 will result in an exception.
265
+ If >1, will fit with `k_fold` folds per n_repeat.
266
+ This splits X and y into `k_fold` chunks to fit `k_fold` models, each with `k-1` chunks used for training and the remaining used for validation.
267
+ If 1, will only fit 1 model using all the training data.
268
+ This is generally reserved for models which are refits of previously trained bags (along with specifying `_skip_oof=True`).
269
+ This can also be used for models which support child oof generation (Random Forest, Extra Trees, KNN).
270
+ If None, defaults to 5 if `groups` is None. Else it will be set based on `groups`.
271
+ k_fold_start : int, default 0
272
+ The fold to start fitting on.
273
+ This allows for fitting only a subset of the bagged ensemble's folds per fit call, if desired.
274
+ k_fold_end : int, default None
275
+ The fold to stop fitting on.
276
+ This allows for fitting only a subset of the bagged ensemble's folds per fit call, if desired.
277
+ If None, will be set to `k_fold`.
278
+ n_repeats : int, default 1
279
+ The number of bagging sets (aka repeats).
280
+ If 1, will only fit `k_fold` models.
281
+ If >1, will fit `n_repeats * k_fold` models.
282
+ For each repeat, will split X and y with an incrementing random seed.
283
+ n_repeat_start : int, default 0
284
+ The repeat to start on.
285
+ This allows for fitting only a subset of the bagged ensemble's repeats per fit call, if desired.
286
+ groups : pd.Series, default None
287
+ If specified, will split X and y based on `groups`, with each sample going to a specific group.
288
+ Overrides `k_fold` and disables `n_repeats>1` if specified.
289
+ _skip_oof : bool, default False
290
+ If True, will not calculate the out-of-fold predictions from the fold models.
291
+ This should be set to True when performing a bagged refit.
292
+ kwargs : dict,
293
+ Arguments passed downstream to the fold models.
294
+
295
+ Returns
296
+ -------
297
+ BaggedEnsembleModel
298
+ The fitted bagged ensemble model.
299
+ In most cases this is `self`.
300
+ If `refit_folds=True`, then instead the refit version of the bagged ensemble is returned.
301
+
302
+ """
243
303
  use_child_oof = self.params.get("use_child_oof", False)
244
304
  if use_child_oof and groups is not None:
245
305
  logger.log(20, f"\tForcing `use_child_oof=False` because `groups` is specified")
@@ -269,6 +329,7 @@ class BaggedEnsembleModel(AbstractModel):
269
329
  n_repeat_start=n_repeat_start,
270
330
  groups=groups,
271
331
  use_child_oof=use_child_oof,
332
+ skip_oof=_skip_oof,
272
333
  )
273
334
  if k_fold_end is None:
274
335
  k_fold_end = k_fold
@@ -384,6 +445,7 @@ class BaggedEnsembleModel(AbstractModel):
384
445
  n_repeat_start: int,
385
446
  groups: pd.Series | None,
386
447
  use_child_oof: bool,
448
+ skip_oof: bool,
387
449
  ):
388
450
  if groups is not None:
389
451
  if self._n_repeats_finished != 0:
@@ -419,7 +481,7 @@ class BaggedEnsembleModel(AbstractModel):
419
481
  f"\tTo enable this logic, `{self._child_type.__name__}._predict_proba_oof` must be implemented "
420
482
  f"and `tags['valid_oof'] = True` must be set in `{self._child_type.__name__}._more_tags`."
421
483
  )
422
- if k_fold == 1 and not use_child_oof and not self._get_tags().get("can_get_oof_from_train", False):
484
+ if k_fold == 1 and not skip_oof and not use_child_oof and not self._get_tags().get("can_get_oof_from_train", False):
423
485
  logger.log(
424
486
  30,
425
487
  f"\tWARNING: Fitting bagged model with `k_fold=1`, "
autogluon/core/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """This is the autogluon version file."""
2
2
 
3
- __version__ = "1.2.1b20250211"
3
+ __version__ = "1.2.1b20250212"
4
4
  __lite__ = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autogluon.core
3
- Version: 1.2.1b20250211
3
+ Version: 1.2.1b20250212
4
4
  Summary: Fast and Accurate ML in 3 Lines of Code
5
5
  Home-page: https://github.com/autogluon/autogluon
6
6
  Author: AutoGluon Community
@@ -45,12 +45,12 @@ Requires-Dist: tqdm<5,>=4.38
45
45
  Requires-Dist: requests
46
46
  Requires-Dist: matplotlib<3.11,>=3.7.0
47
47
  Requires-Dist: boto3<2,>=1.10
48
- Requires-Dist: autogluon.common==1.2.1b20250211
48
+ Requires-Dist: autogluon.common==1.2.1b20250212
49
49
  Provides-Extra: all
50
50
  Requires-Dist: pyarrow>=15.0.0; extra == "all"
51
- Requires-Dist: hyperopt<0.2.8,>=0.2.7; extra == "all"
52
- Requires-Dist: ray[default,tune]<2.41,>=2.10.0; extra == "all"
53
51
  Requires-Dist: ray[default]<2.41,>=2.10.0; extra == "all"
52
+ Requires-Dist: ray[default,tune]<2.41,>=2.10.0; extra == "all"
53
+ Requires-Dist: hyperopt<0.2.8,>=0.2.7; extra == "all"
54
54
  Provides-Extra: ray
55
55
  Requires-Dist: ray[default]<2.41,>=2.10.0; extra == "ray"
56
56
  Provides-Extra: raytune
@@ -58,11 +58,11 @@ Requires-Dist: pyarrow>=15.0.0; extra == "raytune"
58
58
  Requires-Dist: ray[default,tune]<2.41,>=2.10.0; extra == "raytune"
59
59
  Requires-Dist: hyperopt<0.2.8,>=0.2.7; extra == "raytune"
60
60
  Provides-Extra: tests
61
- Requires-Dist: pytest; extra == "tests"
62
61
  Requires-Dist: types-setuptools; extra == "tests"
62
+ Requires-Dist: types-requests; extra == "tests"
63
63
  Requires-Dist: flake8; extra == "tests"
64
+ Requires-Dist: pytest; extra == "tests"
64
65
  Requires-Dist: pytest-mypy; extra == "tests"
65
- Requires-Dist: types-requests; extra == "tests"
66
66
 
67
67
 
68
68
 
@@ -1,9 +1,9 @@
1
- autogluon.core-1.2.1b20250211-py3.9-nspkg.pth,sha256=cQGwpuGPqg1GXscIwt-7PmME1OnSpD-7ixkikJ31WAY,554
1
+ autogluon.core-1.2.1b20250212-py3.9-nspkg.pth,sha256=cQGwpuGPqg1GXscIwt-7PmME1OnSpD-7ixkikJ31WAY,554
2
2
  autogluon/core/__init__.py,sha256=8KfvvHzXX3a4q6z43Dw1yE7VtbAoiSMaglVpKDy6Xeg,245
3
3
  autogluon/core/_setup_utils.py,sha256=ikxn4zc3PNyjJJT5SsgL0dvP-6Rbq6_dItGMiZNINv4,6958
4
4
  autogluon/core/constants.py,sha256=nEVLdSFJ-5O-tz3jUD3qPX65RMp7g8qOR38XlurbP4Y,3403
5
5
  autogluon/core/problem_type.py,sha256=XJmMgeNBgS7u43pDK-spTivatPyh_INOXveEXwQt-Rw,2993
6
- autogluon/core/version.py,sha256=Yxg6A266LJAF_-SqWiU5evmkHb9GvRXqM0ORyZus93M,91
6
+ autogluon/core/version.py,sha256=vms_fwWJg255-etJkP9JffoXqS6CehRG_UCl1XCcnIs,91
7
7
  autogluon/core/augmentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  autogluon/core/augmentation/distill_utils.py,sha256=JBlp2WOMNKoJv8aKVwJVRQSalSk8jx36HM7-k_VvkhY,9404
9
9
  autogluon/core/calibrate/__init__.py,sha256=eU6qLj7DKUhaz2HHNHDrfroRaLM-mhuSncK_v1UP4F8,62
@@ -40,14 +40,14 @@ autogluon/core/models/__init__.py,sha256=dg3onYq5wW3-sfdNurnSIGpX0rpEjG_abgzyfwD
40
40
  autogluon/core/models/_utils.py,sha256=qswE9n1ge1AJSExgstEbrZiMFmMRa4Mf5Sz8D9-XU6c,2091
41
41
  autogluon/core/models/abstract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  autogluon/core/models/abstract/_tags.py,sha256=Qr_3an0ZMig24S3OwISa-nTFfWHQe3pwPTiXq4zlEec,3409
43
- autogluon/core/models/abstract/abstract_model.py,sha256=PiM7WT6clMYPdbVNQbJRg6M5Jz8ws5trY62aUnUCEx4,120461
43
+ autogluon/core/models/abstract/abstract_model.py,sha256=SPknoRqTiRCZfTvoFrf2V3BW4h5MVbrl-2HvSHfCjOM,120532
44
44
  autogluon/core/models/abstract/abstract_nn_model.py,sha256=IId0ivO8uVvmpnK9OiM2CtPVrP1ewOaQQKtQUDtK7_k,4818
45
45
  autogluon/core/models/abstract/model_trial.py,sha256=PKEo1jfLSBCOLM42QE5VBD1u41MaVMRk31zhNhLiqTw,5035
46
46
  autogluon/core/models/dummy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  autogluon/core/models/dummy/_dummy_quantile_regressor.py,sha256=i-ZW2flJ60jsMfMK24IP39Xwc55-UlBDvHmqanIf29Q,664
48
48
  autogluon/core/models/dummy/dummy_model.py,sha256=at2FZSM2_LuAQ78E2YrRCRt3UaKMyyOnc6p2rtZgA2w,1414
49
49
  autogluon/core/models/ensemble/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
- autogluon/core/models/ensemble/bagged_ensemble_model.py,sha256=p3lkm0Cweyu_maOeboirGmQIjIaaiDHXS-XHDc-wYYw,72610
50
+ autogluon/core/models/ensemble/bagged_ensemble_model.py,sha256=8GijtiLwFXugKWWIKY4ss_Xa_EGdASWtvJ2JUJu2avs,75887
51
51
  autogluon/core/models/ensemble/fold_fitting_strategy.py,sha256=01vzNVvE4FIFgD6YqbhK63XoUlSztnVFsrDdsoqm75U,47021
52
52
  autogluon/core/models/ensemble/ray_parallel_fold_fitting_strategy.py,sha256=8RASa-eV6n9kUgbqQHNt7k4IrvuB9NdrunIMLYOLwgA,2068
53
53
  autogluon/core/models/ensemble/stacker_ensemble_model.py,sha256=DuDXgozvG9JYYkRvGACA7EXDAtj3Tz_uAjXTfxu5tFg,18041
@@ -89,11 +89,11 @@ autogluon/core/utils/utils.py,sha256=FMa9kIUAxA3IIBbATmBnNEVObSAivehZ2_zCy3PRR-c
89
89
  autogluon/core/utils/version_utils.py,sha256=5-r8hLRKTaZbj5qo2uzE_2E4casH49Ye3WyeHlgHuz4,3252
90
90
  autogluon/core/utils/loaders/__init__.py,sha256=W5FAdQvpDcn_uisqJrlSAObWVta-YjJLKGN3NCbEgIo,109
91
91
  autogluon/core/utils/savers/__init__.py,sha256=bGWciSxAkj6u06vOC4pTvr22f_1ey0glgvmjCMEOm78,89
92
- autogluon.core-1.2.1b20250211.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
93
- autogluon.core-1.2.1b20250211.dist-info/METADATA,sha256=BQJZOppMfQB_U55W7FdnmYvtg4bx4c098tsfRBd6TL0,12377
94
- autogluon.core-1.2.1b20250211.dist-info/NOTICE,sha256=7nPQuj8Kp-uXsU0S5so3-2dNU5EctS5hDXvvzzehd7E,114
95
- autogluon.core-1.2.1b20250211.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
96
- autogluon.core-1.2.1b20250211.dist-info/namespace_packages.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
97
- autogluon.core-1.2.1b20250211.dist-info/top_level.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
98
- autogluon.core-1.2.1b20250211.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
99
- autogluon.core-1.2.1b20250211.dist-info/RECORD,,
92
+ autogluon.core-1.2.1b20250212.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
93
+ autogluon.core-1.2.1b20250212.dist-info/METADATA,sha256=E3DZU95NdUfpW7rUbM9iF0yUYGjXUtywtVxt9fCUU5I,12377
94
+ autogluon.core-1.2.1b20250212.dist-info/NOTICE,sha256=7nPQuj8Kp-uXsU0S5so3-2dNU5EctS5hDXvvzzehd7E,114
95
+ autogluon.core-1.2.1b20250212.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
96
+ autogluon.core-1.2.1b20250212.dist-info/namespace_packages.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
97
+ autogluon.core-1.2.1b20250212.dist-info/top_level.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
98
+ autogluon.core-1.2.1b20250212.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
99
+ autogluon.core-1.2.1b20250212.dist-info/RECORD,,