autogluon.timeseries 1.1.0b20240412__py3-none-any.whl → 1.1.0b20240413__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
@@ -1,3 +1,3 @@
1
1
  """This is the autogluon version file."""
2
- __version__ = '1.1.0b20240412'
2
+ __version__ = '1.1.0b20240413'
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.0b20240413
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
@@ -52,9 +52,9 @@ Requires-Dist: utilsforecast <0.0.11,>=0.0.10
52
52
  Requires-Dist: tqdm <5,>=4.38
53
53
  Requires-Dist: orjson ~=3.9
54
54
  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
55
+ Requires-Dist: autogluon.core[raytune] ==1.1.0b20240413
56
+ Requires-Dist: autogluon.common ==1.1.0b20240413
57
+ Requires-Dist: autogluon.tabular[catboost,lightgbm,xgboost] ==1.1.0b20240413
58
58
  Provides-Extra: all
59
59
  Requires-Dist: optimum[onnxruntime] <1.19,>=1.17 ; extra == 'all'
60
60
  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.0b20240413-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
5
  autogluon/timeseries/predictor.py,sha256=w9YWluyCVoFabeKOvfV7GiPNe7Z7pV2JDjOt8mXUdJo,81219
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=ETLCo_tdf4OsWKQFt1lRtqCdrOfmJJBEG_xQxg4cx_8,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
@@ -52,11 +52,11 @@ autogluon/timeseries/utils/datetime/base.py,sha256=3NdsH3NDq4cVAOSoy3XpaNixyNlbj
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.0b20240413.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
56
+ autogluon.timeseries-1.1.0b20240413.dist-info/METADATA,sha256=EIo6XGf1Fnl2ulkW2Yd9Cn1_Dlx1Kecau4H-yRO7vKs,12530
57
+ autogluon.timeseries-1.1.0b20240413.dist-info/NOTICE,sha256=7nPQuj8Kp-uXsU0S5so3-2dNU5EctS5hDXvvzzehd7E,114
58
+ autogluon.timeseries-1.1.0b20240413.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
59
+ autogluon.timeseries-1.1.0b20240413.dist-info/namespace_packages.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
60
+ autogluon.timeseries-1.1.0b20240413.dist-info/top_level.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
61
+ autogluon.timeseries-1.1.0b20240413.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
62
+ autogluon.timeseries-1.1.0b20240413.dist-info/RECORD,,