autogluon.timeseries 1.1.0b20240412__py3-none-any.whl → 1.1.0b20240414__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.

Potentially problematic release.


This version of autogluon.timeseries might be problematic. Click here for more details.

@@ -337,7 +337,7 @@ class AbstractMLForecastModel(AbstractTimeSeriesModel):
337
337
  Seasonal naive forecast for short series, if there are any in the dataset.
338
338
  """
339
339
  ts_lengths = data.num_timesteps_per_item()
340
- short_series = ts_lengths.index[ts_lengths <= self._sum_of_differences]
340
+ short_series = ts_lengths.index[ts_lengths <= self._sum_of_differences + 1]
341
341
  if len(short_series) > 0:
342
342
  logger.warning(
343
343
  f"Warning: {len(short_series)} time series ({len(short_series) / len(ts_lengths):.1%}) are shorter "
@@ -25,6 +25,7 @@ from autogluon.tabular.models.tabular_nn.utils.categorical_encoders import (
25
25
  )
26
26
  from autogluon.timeseries.dataset.ts_dataframe import ITEMID, TIMESTAMP, TimeSeriesDataFrame
27
27
  from autogluon.timeseries.models.abstract import AbstractTimeSeriesModel
28
+ from autogluon.timeseries.utils.datetime import norm_freq_str
28
29
  from autogluon.timeseries.utils.forecast import get_forecast_horizon_index_ts_dataframe
29
30
  from autogluon.timeseries.utils.warning_filters import disable_root_logger, warning_filter
30
31
 
@@ -38,11 +39,10 @@ gts_logger = logging.getLogger(gluonts.__name__)
38
39
  class SimpleGluonTSDataset(GluonTSDataset):
39
40
  """Wrapper for TimeSeriesDataFrame that is compatible with the GluonTS Dataset API."""
40
41
 
41
- _dummy_gluonts_freq = "D"
42
-
43
42
  def __init__(
44
43
  self,
45
44
  target_df: TimeSeriesDataFrame,
45
+ freq: str,
46
46
  target_column: str = "target",
47
47
  feat_static_cat: Optional[np.ndarray] = None,
48
48
  feat_static_real: Optional[np.ndarray] = None,
@@ -62,6 +62,7 @@ class SimpleGluonTSDataset(GluonTSDataset):
62
62
  self.feat_dynamic_real = self._astype(feat_dynamic_real, dtype=np.float32)
63
63
  self.past_feat_dynamic_cat = self._astype(past_feat_dynamic_cat, dtype=np.int64)
64
64
  self.past_feat_dynamic_real = self._astype(past_feat_dynamic_real, dtype=np.float32)
65
+ self.freq = self._get_freq_for_period(freq)
65
66
 
66
67
  # Necessary to compute indptr for known_covariates at prediction time
67
68
  self.includes_future = includes_future
@@ -83,6 +84,24 @@ class SimpleGluonTSDataset(GluonTSDataset):
83
84
  else:
84
85
  return array.astype(dtype)
85
86
 
87
+ @staticmethod
88
+ def _get_freq_for_period(freq: str) -> str:
89
+ """Convert freq to format compatible with pd.Period.
90
+
91
+ For example, ME freq must be converted to M when creating a pd.Period.
92
+ """
93
+ offset = pd.tseries.frequencies.to_offset(freq)
94
+ freq_name = norm_freq_str(offset)
95
+ if freq_name == "SME":
96
+ # Replace unsupported frequency "SME" with "2W"
97
+ return "2W"
98
+ elif freq_name == "bh":
99
+ # Replace unsupported frequency "bh" with dummy value "Y"
100
+ return "Y"
101
+ else:
102
+ freq_name_for_period = {"YE": "Y", "QE": "Q", "ME": "M"}.get(freq_name, freq_name)
103
+ return f"{offset.n}{freq_name_for_period}"
104
+
86
105
  def __len__(self):
87
106
  return len(self.indptr) - 1 # noqa
88
107
 
@@ -93,7 +112,7 @@ class SimpleGluonTSDataset(GluonTSDataset):
93
112
  # GluonTS expects item_id to be a string
94
113
  ts = {
95
114
  FieldName.ITEM_ID: str(self.item_ids[j]),
96
- FieldName.START: pd.Period(self.start_timestamps.iloc[j], freq=self._dummy_gluonts_freq),
115
+ FieldName.START: pd.Period(self.start_timestamps.iloc[j], freq=self.freq),
97
116
  FieldName.TARGET: self.target_array[start_idx:end_idx],
98
117
  }
99
118
  if self.feat_static_cat is not None:
@@ -141,6 +160,8 @@ class AbstractGluonTSModel(AbstractTimeSeriesModel):
141
160
  """
142
161
 
143
162
  gluonts_model_path = "gluon_ts"
163
+ # we pass dummy freq compatible with pandas 2.1 & 2.2 to GluonTS models
164
+ _dummy_gluonts_freq = "D"
144
165
  # default number of samples for prediction
145
166
  default_num_samples: int = 250
146
167
  supports_cat_covariates: bool = False
@@ -344,7 +365,7 @@ class AbstractGluonTSModel(AbstractTimeSeriesModel):
344
365
  init_args.setdefault("early_stopping_patience", 20)
345
366
  init_args.update(
346
367
  dict(
347
- freq=self.freq,
368
+ freq=self._dummy_gluonts_freq,
348
369
  prediction_length=self.prediction_length,
349
370
  quantiles=self.quantile_levels,
350
371
  callbacks=self.callbacks,
@@ -475,6 +496,7 @@ class AbstractGluonTSModel(AbstractTimeSeriesModel):
475
496
 
476
497
  return SimpleGluonTSDataset(
477
498
  target_df=time_series_df[[self.target]],
499
+ freq=self.freq,
478
500
  target_column=self.target,
479
501
  feat_static_cat=feat_static_cat,
480
502
  feat_static_real=feat_static_real,
@@ -423,6 +423,4 @@ class WaveNetModel(AbstractGluonTSModel):
423
423
  init_kwargs.setdefault("seasonality", get_seasonality(self.freq))
424
424
  init_kwargs.setdefault("time_features", get_time_features_for_frequency(self.freq))
425
425
  init_kwargs.setdefault("num_parallel_samples", self.default_num_samples)
426
- # WaveNet model fails if an unsupported frequency such as "SM" is provided. We provide a dummy freq instead
427
- init_kwargs["freq"] = "D"
428
426
  return init_kwargs
@@ -631,7 +631,11 @@ class TimeSeriesPredictor(TimeSeriesPredictorDeprecatedMixin):
631
631
  This argument has no effect if ``tuning_data`` is provided.
632
632
  refit_every_n_windows: int or None, default = 1
633
633
  When performing cross validation, each model will be retrained every ``refit_every_n_windows`` validation
634
- windows. If set to ``None``, model will only be fit once for the first validation window.
634
+ windows, where the number of validation windows is specified by `num_val_windows`. Note that in the
635
+ default setting where `num_val_windows=1`, this argument has no effect.
636
+
637
+ If set to ``None``, models will only be fit once for the first (oldest) validation window. By default,
638
+ `refit_every_n_windows=1`, i.e., all models will be refit for each validation window.
635
639
  refit_full : bool, default = False
636
640
  If True, after training is complete, AutoGluon will attempt to re-train all models using all of training
637
641
  data (including the data initially reserved for validation). This argument has no effect if ``tuning_data``
@@ -717,6 +721,12 @@ class TimeSeriesPredictor(TimeSeriesPredictorDeprecatedMixin):
717
721
  if num_val_windows == 0 and tuning_data is None:
718
722
  raise ValueError("Please set num_val_windows >= 1 or provide custom tuning_data")
719
723
 
724
+ if num_val_windows <= 1 and refit_every_n_windows > 1:
725
+ logger.warning(
726
+ f"\trefit_every_n_windows provided as {refit_every_n_windows} but num_val_windows is set to {num_val_windows}."
727
+ " Refit_every_n_windows will have no effect."
728
+ )
729
+
720
730
  if not skip_model_selection:
721
731
  train_data = self._filter_useless_train_data(
722
732
  train_data, num_val_windows=num_val_windows, val_step_size=val_step_size
@@ -7,14 +7,12 @@ import re
7
7
  import sys
8
8
  import warnings
9
9
 
10
- from statsmodels.tools.sm_exceptions import ConvergenceWarning, ValueWarning
11
-
12
10
  __all__ = ["warning_filter", "disable_root_logger", "disable_tqdm"]
13
11
 
14
12
 
15
13
  @contextlib.contextmanager
16
14
  def warning_filter(all_warnings: bool = False):
17
- categories = [RuntimeWarning, UserWarning, ConvergenceWarning, ValueWarning, FutureWarning]
15
+ categories = [RuntimeWarning, UserWarning, FutureWarning]
18
16
  if all_warnings:
19
17
  categories.append(Warning)
20
18
  with warnings.catch_warnings():
@@ -1,3 +1,3 @@
1
1
  """This is the autogluon version file."""
2
- __version__ = '1.1.0b20240412'
2
+ __version__ = '1.1.0b20240414'
3
3
  __lite__ = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autogluon.timeseries
3
- Version: 1.1.0b20240412
3
+ Version: 1.1.0b20240414
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
@@ -43,7 +43,6 @@ Requires-Dist: lightning <2.2,>=2.1
43
43
  Requires-Dist: pytorch-lightning <2.2,>=2.1
44
44
  Requires-Dist: transformers[sentencepiece] <4.39.0,>=4.38.0
45
45
  Requires-Dist: accelerate <0.22.0,>=0.21.0
46
- Requires-Dist: statsmodels <0.15,>=0.13.0
47
46
  Requires-Dist: gluonts <0.14.4,>=0.14.0
48
47
  Requires-Dist: networkx <4,>=3.0
49
48
  Requires-Dist: statsforecast <1.5,>=1.4.0
@@ -52,9 +51,9 @@ Requires-Dist: utilsforecast <0.0.11,>=0.0.10
52
51
  Requires-Dist: tqdm <5,>=4.38
53
52
  Requires-Dist: orjson ~=3.9
54
53
  Requires-Dist: tensorboard <3,>=2.9
55
- Requires-Dist: autogluon.core[raytune] ==1.1.0b20240412
56
- Requires-Dist: autogluon.common ==1.1.0b20240412
57
- Requires-Dist: autogluon.tabular[catboost,lightgbm,xgboost] ==1.1.0b20240412
54
+ Requires-Dist: autogluon.core[raytune] ==1.1.0b20240414
55
+ Requires-Dist: autogluon.common ==1.1.0b20240414
56
+ Requires-Dist: autogluon.tabular[catboost,lightgbm,xgboost] ==1.1.0b20240414
58
57
  Provides-Extra: all
59
58
  Requires-Dist: optimum[onnxruntime] <1.19,>=1.17 ; extra == 'all'
60
59
  Provides-Extra: chronos-onnx
@@ -1,10 +1,10 @@
1
- autogluon.timeseries-1.1.0b20240412-py3.8-nspkg.pth,sha256=cQGwpuGPqg1GXscIwt-7PmME1OnSpD-7ixkikJ31WAY,554
1
+ autogluon.timeseries-1.1.0b20240414-py3.8-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=IYXpJSDyTzjZXjKL_SrTujt5Uke83mSJFA0sMj25_sM,13828
5
- autogluon/timeseries/predictor.py,sha256=w9YWluyCVoFabeKOvfV7GiPNe7Z7pV2JDjOt8mXUdJo,81219
5
+ autogluon/timeseries/predictor.py,sha256=9PGGTbmYfkl3JQ2n-9T0Ucyfdiyq6gX9WhMDZ1cM-9U,81823
6
6
  autogluon/timeseries/splitter.py,sha256=eghGwAAN2_cxGk5aJBILgjGWtLzjxJcytMy49gg_q18,3061
7
- autogluon/timeseries/version.py,sha256=x3pjPHRSXvEKGk0gDn7ARHXnZxx2LjH9RjumNUkaoeY,90
7
+ autogluon/timeseries/version.py,sha256=Poy70LftZj-bttK37JGpP5-9yPZZyFx8O_OxUewqYXk,90
8
8
  autogluon/timeseries/configs/__init__.py,sha256=BTtHIPCYeGjqgOcvqb8qPD4VNX-ICKOg6wnkew1cPOE,98
9
9
  autogluon/timeseries/configs/presets_configs.py,sha256=ZVV8BsnGnnHPgjBtJBqF-H35MYUdzRBQ8FP7zA3_11g,1949
10
10
  autogluon/timeseries/dataset/__init__.py,sha256=UvnhAN5tjgxXTHoZMQDy64YMDj4Xxa68yY7NP4vAw0o,81
@@ -20,7 +20,7 @@ autogluon/timeseries/models/abstract/__init__.py,sha256=wvDsQAZIV0N3AwBeMaGItoQ8
20
20
  autogluon/timeseries/models/abstract/abstract_timeseries_model.py,sha256=MvLF529b3fo0icgle-qmS0oce-ftiiQ1jPBLnY-39fk,23435
21
21
  autogluon/timeseries/models/abstract/model_trial.py,sha256=ENPg_7nsdxIvaNM0o0UShZ3x8jFlRmwRc5m0fGPC0TM,3720
22
22
  autogluon/timeseries/models/autogluon_tabular/__init__.py,sha256=r9i6jWcyeLHYClkcMSKRVsfrkBUMxpDrTATNTBc_qgQ,136
23
- autogluon/timeseries/models/autogluon_tabular/mlforecast.py,sha256=lnHzCoMF6x9jZOzRM4zSlcXmx0XmtRlsPoiE-LWmqQ0,31299
23
+ autogluon/timeseries/models/autogluon_tabular/mlforecast.py,sha256=v-0-kTlWSm2BCRT60JvroKtoQefSDEsvtubqlRq3pmQ,31303
24
24
  autogluon/timeseries/models/autogluon_tabular/utils.py,sha256=4-gTrBtizxeMVQlsuscugPqw9unaXWXhS1TVVssfzYY,2125
25
25
  autogluon/timeseries/models/chronos/__init__.py,sha256=wT77HzTtmQxW3sw2k0mA5Ot6PSHivX-Uvn5fjM05EU4,60
26
26
  autogluon/timeseries/models/chronos/model.py,sha256=0ZxOpGyx7MmXYDr9zeDt6-rIu50Bm7ssR9zTIvd6vmQ,14659
@@ -30,9 +30,9 @@ autogluon/timeseries/models/ensemble/__init__.py,sha256=kFr11Gmt7lQJu9Rr8HuIPphQ
30
30
  autogluon/timeseries/models/ensemble/abstract_timeseries_ensemble.py,sha256=tifETwmiEGt-YtQ9eNK7ojJ3fBvtFMUJvisbfkIJ7gw,3393
31
31
  autogluon/timeseries/models/ensemble/greedy_ensemble.py,sha256=5HvZuW5osgsZg3V69k82nKEOy_YgeH1JTfQa7F3cU7s,7220
32
32
  autogluon/timeseries/models/gluonts/__init__.py,sha256=M8PV9ZE4WpteScMobXM6RH1Udb1AZiHHtj2g5GQL3TU,329
33
- autogluon/timeseries/models/gluonts/abstract_gluonts.py,sha256=iB3-VNZeg2Wf7rW1WeKDAOJyh2ZGuq2BU309OirBFqc,33055
33
+ autogluon/timeseries/models/gluonts/abstract_gluonts.py,sha256=X4KChuSVSoxLOcrto1SgwAgiHeCuE5jFOaX8GxdBTeg,34017
34
34
  autogluon/timeseries/models/gluonts/torch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- autogluon/timeseries/models/gluonts/torch/models.py,sha256=vzR-FRHSQDC76z2cK37eVDzs7tCXvGpZtrvtZptyP5Y,19930
35
+ autogluon/timeseries/models/gluonts/torch/models.py,sha256=Eo_AI5bWpHx3_05lnates4tnessBrUrVkUAyGoAb0zk,19780
36
36
  autogluon/timeseries/models/local/__init__.py,sha256=JyckWWgMG1BTIWJqFTW6e1O-eb0LPPOwtXwmb1ErohQ,756
37
37
  autogluon/timeseries/models/local/abstract_local_model.py,sha256=5wvwt7d99kw-PTDnuT45uoCeXk6POjUArCAwUj8mSok,11836
38
38
  autogluon/timeseries/models/local/naive.py,sha256=iwRcFMFmJKPWPbD9TWaIUS51oav69F_VAp6-jb_5SUE,7249
@@ -46,17 +46,17 @@ autogluon/timeseries/trainer/auto_trainer.py,sha256=psJFZBwWWPlLjNwAgvO4OUJXsRW1
46
46
  autogluon/timeseries/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  autogluon/timeseries/utils/features.py,sha256=kG1xin3VCjtLwfaDkxlGKaesS7Ah-hIvsUNdwToLxYY,19492
48
48
  autogluon/timeseries/utils/forecast.py,sha256=p0WKM9Q0nLAwwmCgYZI1zi9mCOWXWJfllEt2lPRQl4M,1882
49
- autogluon/timeseries/utils/warning_filters.py,sha256=ngjmfv21zIwTG-7VNZT-NkaSR7ssnoNtUwcXCXANZ4A,2076
49
+ autogluon/timeseries/utils/warning_filters.py,sha256=HMXNDo9jOUdf9wvyp-Db55xTq_Ctj6uso7qPhngoJPQ,1964
50
50
  autogluon/timeseries/utils/datetime/__init__.py,sha256=bTMR8jLh1LW55vHjbOr1zvWRMF_PqbvxpS-cUcNIDWI,173
51
51
  autogluon/timeseries/utils/datetime/base.py,sha256=3NdsH3NDq4cVAOSoy3XpaNixyNlbjy4DJ_YYOGuu9x4,1341
52
52
  autogluon/timeseries/utils/datetime/lags.py,sha256=GoLtvcZ8oKb3QkoBJ9E59LSPLOP7Qjxrr2UmMSZgjyw,5909
53
53
  autogluon/timeseries/utils/datetime/seasonality.py,sha256=h_4w00iEytAz_N_EpCENQ8RCXy7KQITczrYjBgVqWkQ,764
54
54
  autogluon/timeseries/utils/datetime/time_features.py,sha256=PAXbYbQ0z_5GFbkxSNi41zLY_2-U3x0Ynm1m_WhdtGc,2572
55
- autogluon.timeseries-1.1.0b20240412.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
56
- autogluon.timeseries-1.1.0b20240412.dist-info/METADATA,sha256=KsqIZCL5sRlmJ90KadBcOSXKeL2XazvcaT1LLw1FF1Y,12530
57
- autogluon.timeseries-1.1.0b20240412.dist-info/NOTICE,sha256=7nPQuj8Kp-uXsU0S5so3-2dNU5EctS5hDXvvzzehd7E,114
58
- autogluon.timeseries-1.1.0b20240412.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
59
- autogluon.timeseries-1.1.0b20240412.dist-info/namespace_packages.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
60
- autogluon.timeseries-1.1.0b20240412.dist-info/top_level.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
61
- autogluon.timeseries-1.1.0b20240412.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
62
- autogluon.timeseries-1.1.0b20240412.dist-info/RECORD,,
55
+ autogluon.timeseries-1.1.0b20240414.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
56
+ autogluon.timeseries-1.1.0b20240414.dist-info/METADATA,sha256=WXC5Hg9xK24Vwmt8QBeX8YpwrIwbNAWHayVnb_Kzx6Q,12488
57
+ autogluon.timeseries-1.1.0b20240414.dist-info/NOTICE,sha256=7nPQuj8Kp-uXsU0S5so3-2dNU5EctS5hDXvvzzehd7E,114
58
+ autogluon.timeseries-1.1.0b20240414.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
59
+ autogluon.timeseries-1.1.0b20240414.dist-info/namespace_packages.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
60
+ autogluon.timeseries-1.1.0b20240414.dist-info/top_level.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
61
+ autogluon.timeseries-1.1.0b20240414.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
62
+ autogluon.timeseries-1.1.0b20240414.dist-info/RECORD,,