autogluon.timeseries 1.2.1b20250402__py3-none-any.whl → 1.2.1b20250403__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.
- autogluon/timeseries/trainer.py +26 -17
- autogluon/timeseries/version.py +1 -1
- {autogluon.timeseries-1.2.1b20250402.dist-info → autogluon.timeseries-1.2.1b20250403.dist-info}/METADATA +4 -4
- {autogluon.timeseries-1.2.1b20250402.dist-info → autogluon.timeseries-1.2.1b20250403.dist-info}/RECORD +11 -11
- /autogluon.timeseries-1.2.1b20250402-py3.9-nspkg.pth → /autogluon.timeseries-1.2.1b20250403-py3.9-nspkg.pth +0 -0
- {autogluon.timeseries-1.2.1b20250402.dist-info → autogluon.timeseries-1.2.1b20250403.dist-info}/LICENSE +0 -0
- {autogluon.timeseries-1.2.1b20250402.dist-info → autogluon.timeseries-1.2.1b20250403.dist-info}/NOTICE +0 -0
- {autogluon.timeseries-1.2.1b20250402.dist-info → autogluon.timeseries-1.2.1b20250403.dist-info}/WHEEL +0 -0
- {autogluon.timeseries-1.2.1b20250402.dist-info → autogluon.timeseries-1.2.1b20250403.dist-info}/namespace_packages.txt +0 -0
- {autogluon.timeseries-1.2.1b20250402.dist-info → autogluon.timeseries-1.2.1b20250403.dist-info}/top_level.txt +0 -0
- {autogluon.timeseries-1.2.1b20250402.dist-info → autogluon.timeseries-1.2.1b20250403.dist-info}/zip-safe +0 -0
autogluon/timeseries/trainer.py
CHANGED
@@ -53,6 +53,7 @@ class TimeSeriesTrainer(AbstractTrainer[AbstractTimeSeriesModel]):
|
|
53
53
|
verbosity: int = 2,
|
54
54
|
val_splitter: Optional[AbstractWindowSplitter] = None,
|
55
55
|
refit_every_n_windows: Optional[int] = 1,
|
56
|
+
# TODO: Set cache_predictions=False by default once all models in default presets have a reasonable inference speed
|
56
57
|
cache_predictions: bool = True,
|
57
58
|
ensemble_model_type: Optional[Type] = None,
|
58
59
|
**kwargs,
|
@@ -752,6 +753,8 @@ class TimeSeriesTrainer(AbstractTrainer[AbstractTimeSeriesModel]):
|
|
752
753
|
if isinstance(model, AbstractTimeSeriesModel):
|
753
754
|
return model.name
|
754
755
|
else:
|
756
|
+
if model not in self.get_model_names():
|
757
|
+
raise KeyError(f"Model '{model}' not found. Available models: {self.get_model_names()}")
|
755
758
|
return model
|
756
759
|
|
757
760
|
def predict(
|
@@ -1033,7 +1036,6 @@ class TimeSeriesTrainer(AbstractTrainer[AbstractTimeSeriesModel]):
|
|
1033
1036
|
use_cache
|
1034
1037
|
If False, will ignore the cache even if it's available.
|
1035
1038
|
"""
|
1036
|
-
# TODO: Unify design of the method with Tabular
|
1037
1039
|
if self.cache_predictions and use_cache:
|
1038
1040
|
dataset_hash = self._compute_dataset_hash(data=data, known_covariates=known_covariates)
|
1039
1041
|
model_pred_dict, pred_time_dict_marginal = self._get_cached_pred_dicts(dataset_hash)
|
@@ -1105,21 +1107,33 @@ class TimeSeriesTrainer(AbstractTrainer[AbstractTimeSeriesModel]):
|
|
1105
1107
|
combined_hash = hash_pandas_df(data) + hash_pandas_df(known_covariates) + hash_pandas_df(data.static_features)
|
1106
1108
|
return combined_hash
|
1107
1109
|
|
1110
|
+
def _load_cached_predictions(self) -> dict[str, dict[str, dict[str, Any]]]:
|
1111
|
+
"""Load cached predictions from disk. If loading fails, an empty dictionary is returned."""
|
1112
|
+
if self._cached_predictions_path.exists():
|
1113
|
+
try:
|
1114
|
+
cached_predictions = load_pkl.load(str(self._cached_predictions_path))
|
1115
|
+
except Exception:
|
1116
|
+
cached_predictions = {}
|
1117
|
+
else:
|
1118
|
+
cached_predictions = {}
|
1119
|
+
return cached_predictions
|
1120
|
+
|
1108
1121
|
def _get_cached_pred_dicts(
|
1109
1122
|
self, dataset_hash: str
|
1110
1123
|
) -> Tuple[Dict[str, Optional[TimeSeriesDataFrame]], Dict[str, float]]:
|
1111
|
-
"""Load cached predictions for given dataset_hash from disk, if possible.
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1124
|
+
"""Load cached predictions for given dataset_hash from disk, if possible.
|
1125
|
+
|
1126
|
+
If loading fails for any reason, empty dicts are returned.
|
1127
|
+
"""
|
1128
|
+
cached_predictions = self._load_cached_predictions()
|
1129
|
+
if dataset_hash in cached_predictions:
|
1130
|
+
try:
|
1115
1131
|
model_pred_dict = cached_predictions[dataset_hash]["model_pred_dict"]
|
1116
1132
|
pred_time_dict = cached_predictions[dataset_hash]["pred_time_dict"]
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
logger.warning(f"Found corrupted cached predictions in {self._cached_predictions_path}")
|
1122
|
-
logger.debug("Found no cached predictions")
|
1133
|
+
assert model_pred_dict.keys() == pred_time_dict.keys()
|
1134
|
+
return model_pred_dict, pred_time_dict
|
1135
|
+
except Exception:
|
1136
|
+
logger.warning("Cached predictions are corrupted. Predictions will be made from scratch.")
|
1123
1137
|
return {}, {}
|
1124
1138
|
|
1125
1139
|
def _save_cached_pred_dicts(
|
@@ -1128,12 +1142,7 @@ class TimeSeriesTrainer(AbstractTrainer[AbstractTimeSeriesModel]):
|
|
1128
1142
|
model_pred_dict: Dict[str, Optional[TimeSeriesDataFrame]],
|
1129
1143
|
pred_time_dict: Dict[str, float],
|
1130
1144
|
) -> None:
|
1131
|
-
|
1132
|
-
if self._cached_predictions_path.exists():
|
1133
|
-
logger.debug("Extending existing cached predictions")
|
1134
|
-
cached_predictions = load_pkl.load(str(self._cached_predictions_path))
|
1135
|
-
else:
|
1136
|
-
cached_predictions = {}
|
1145
|
+
cached_predictions = self._load_cached_predictions()
|
1137
1146
|
# Do not save results for models that failed
|
1138
1147
|
cached_predictions[dataset_hash] = {
|
1139
1148
|
"model_pred_dict": {k: v for k, v in model_pred_dict.items() if v is not None},
|
autogluon/timeseries/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: autogluon.timeseries
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.1b20250403
|
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
|
@@ -55,9 +55,9 @@ Requires-Dist: fugue>=0.9.0
|
|
55
55
|
Requires-Dist: tqdm<5,>=4.38
|
56
56
|
Requires-Dist: orjson~=3.9
|
57
57
|
Requires-Dist: tensorboard<3,>=2.9
|
58
|
-
Requires-Dist: autogluon.core[raytune]==1.2.
|
59
|
-
Requires-Dist: autogluon.common==1.2.
|
60
|
-
Requires-Dist: autogluon.tabular[catboost,lightgbm,xgboost]==1.2.
|
58
|
+
Requires-Dist: autogluon.core[raytune]==1.2.1b20250403
|
59
|
+
Requires-Dist: autogluon.common==1.2.1b20250403
|
60
|
+
Requires-Dist: autogluon.tabular[catboost,lightgbm,xgboost]==1.2.1b20250403
|
61
61
|
Provides-Extra: all
|
62
62
|
Provides-Extra: chronos-onnx
|
63
63
|
Requires-Dist: optimum[onnxruntime]<1.20,>=1.17; extra == "chronos-onnx"
|
@@ -1,12 +1,12 @@
|
|
1
|
-
autogluon.timeseries-1.2.
|
1
|
+
autogluon.timeseries-1.2.1b20250403-py3.9-nspkg.pth,sha256=cQGwpuGPqg1GXscIwt-7PmME1OnSpD-7ixkikJ31WAY,554
|
2
2
|
autogluon/timeseries/__init__.py,sha256=_CrLLc1fkjen7UzWoO0Os8WZoHOgvZbHKy46I8v_4k4,304
|
3
3
|
autogluon/timeseries/evaluator.py,sha256=l642tYfTHsl8WVIq_vV6qhgAFVFr9UuZD7gLra3A_Kc,250
|
4
4
|
autogluon/timeseries/learner.py,sha256=PDAHFlos6q5JukwRE86tKoH0zxYf3nLzy7qfD_a5NYY,13849
|
5
5
|
autogluon/timeseries/predictor.py,sha256=DgKNvDfduVyauR7MXQZk04JyT3fc5erXAGVp3XOwDt4,85288
|
6
6
|
autogluon/timeseries/regressor.py,sha256=3MlTpP-M1ayTZ52UQDK0wIMMFUijPep-iEyftlDdKPg,11804
|
7
7
|
autogluon/timeseries/splitter.py,sha256=yzPca9p2bWV-_VJAptUyyzQsxu-uixAdpMoGQtDzMD4,3205
|
8
|
-
autogluon/timeseries/trainer.py,sha256=
|
9
|
-
autogluon/timeseries/version.py,sha256=
|
8
|
+
autogluon/timeseries/trainer.py,sha256=EPKyWDpDnKK9ynUNKnnW_Zkg4UyPkxCUarIjngAFLWc,57525
|
9
|
+
autogluon/timeseries/version.py,sha256=1df-aoA8H9q3DJauV_Wnd-7USFCO23BO5y92X8TSpDI,91
|
10
10
|
autogluon/timeseries/configs/__init__.py,sha256=BTtHIPCYeGjqgOcvqb8qPD4VNX-ICKOg6wnkew1cPOE,98
|
11
11
|
autogluon/timeseries/configs/presets_configs.py,sha256=cLat8ecLlWrI-SC5KLBDCX2SbVXaucemy2pjxJAtSY0,2543
|
12
12
|
autogluon/timeseries/dataset/__init__.py,sha256=UvnhAN5tjgxXTHoZMQDy64YMDj4Xxa68yY7NP4vAw0o,81
|
@@ -59,11 +59,11 @@ autogluon/timeseries/utils/datetime/base.py,sha256=3NdsH3NDq4cVAOSoy3XpaNixyNlbj
|
|
59
59
|
autogluon/timeseries/utils/datetime/lags.py,sha256=gQDk5_zmsY5DUWDUpSaCKYkQ9nHKKY-LsywJQRAoYSk,5988
|
60
60
|
autogluon/timeseries/utils/datetime/seasonality.py,sha256=YK_2k8hvYIMW-sJPnjGWRtCnvIOthwA2hATB3nwVoD4,834
|
61
61
|
autogluon/timeseries/utils/datetime/time_features.py,sha256=MjLi3zQ00uWWJtXH9oGX2GJkTbvjdSiuabSa4kcVuxE,2672
|
62
|
-
autogluon.timeseries-1.2.
|
63
|
-
autogluon.timeseries-1.2.
|
64
|
-
autogluon.timeseries-1.2.
|
65
|
-
autogluon.timeseries-1.2.
|
66
|
-
autogluon.timeseries-1.2.
|
67
|
-
autogluon.timeseries-1.2.
|
68
|
-
autogluon.timeseries-1.2.
|
69
|
-
autogluon.timeseries-1.2.
|
62
|
+
autogluon.timeseries-1.2.1b20250403.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
|
63
|
+
autogluon.timeseries-1.2.1b20250403.dist-info/METADATA,sha256=cfAyX23oWUcORit7OQ9xGujEioQc-T5ClXIdxnpASiM,12684
|
64
|
+
autogluon.timeseries-1.2.1b20250403.dist-info/NOTICE,sha256=7nPQuj8Kp-uXsU0S5so3-2dNU5EctS5hDXvvzzehd7E,114
|
65
|
+
autogluon.timeseries-1.2.1b20250403.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
66
|
+
autogluon.timeseries-1.2.1b20250403.dist-info/namespace_packages.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
|
67
|
+
autogluon.timeseries-1.2.1b20250403.dist-info/top_level.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
|
68
|
+
autogluon.timeseries-1.2.1b20250403.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
69
|
+
autogluon.timeseries-1.2.1b20250403.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|