autogluon.timeseries 1.0.0b20231124__tar.gz → 1.0.0b20231125__tar.gz
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.
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/PKG-INFO +1 -1
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/dataset/ts_dataframe.py +30 -4
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/gluonts/abstract_gluonts.py +1 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/version.py +1 -1
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon.timeseries.egg-info/PKG-INFO +1 -1
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon.timeseries.egg-info/requires.txt +3 -3
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/setup.cfg +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/setup.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/configs/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/configs/presets_configs.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/dataset/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/evaluator.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/learner.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/metrics/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/metrics/abstract.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/metrics/point.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/metrics/quantile.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/metrics/utils.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/abstract/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/abstract/abstract_timeseries_model.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/abstract/model_trial.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/autogluon_tabular/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/autogluon_tabular/mlforecast.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/autogluon_tabular/utils.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/ensemble/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/ensemble/abstract_timeseries_ensemble.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/ensemble/greedy_ensemble.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/gluonts/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/gluonts/torch/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/gluonts/torch/models.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/local/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/local/abstract_local_model.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/local/naive.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/local/npts.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/local/statsforecast.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/multi_window/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/multi_window/multi_window_model.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/models/presets.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/predictor.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/splitter.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/trainer/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/trainer/abstract_trainer.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/trainer/auto_trainer.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/datetime/__init__.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/datetime/base.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/datetime/lags.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/datetime/seasonality.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/datetime/time_features.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/features.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/forecast.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon/timeseries/utils/warning_filters.py +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon.timeseries.egg-info/SOURCES.txt +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon.timeseries.egg-info/dependency_links.txt +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon.timeseries.egg-info/namespace_packages.txt +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon.timeseries.egg-info/top_level.txt +0 -0
- {autogluon.timeseries-1.0.0b20231124 → autogluon.timeseries-1.0.0b20231125}/src/autogluon.timeseries.egg-info/zip-safe +0 -0
|
@@ -5,6 +5,7 @@ import itertools
|
|
|
5
5
|
import logging
|
|
6
6
|
import reprlib
|
|
7
7
|
from collections.abc import Iterable
|
|
8
|
+
from itertools import islice
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
from typing import Any, List, Optional, Tuple, Type, Union
|
|
10
11
|
|
|
@@ -849,6 +850,8 @@ class TimeSeriesDataFrame(pd.DataFrame):
|
|
|
849
850
|
freq: Union[str, pd.DateOffset],
|
|
850
851
|
agg_numeric: str = "mean",
|
|
851
852
|
agg_categorical: str = "first",
|
|
853
|
+
num_cpus: int = -1,
|
|
854
|
+
chunk_size: int = 100,
|
|
852
855
|
**kwargs,
|
|
853
856
|
) -> TimeSeriesDataFrame:
|
|
854
857
|
"""Convert each time series in the data frame to the given frequency.
|
|
@@ -858,6 +861,10 @@ class TimeSeriesDataFrame(pd.DataFrame):
|
|
|
858
861
|
1. Converting an irregularly-sampled time series to a regular time index.
|
|
859
862
|
2. Aggregating time series data by downsampling (e.g., convert daily sales into weekly sales)
|
|
860
863
|
|
|
864
|
+
Standard ``df.groupby(...).resample(...)`` can be extremely slow for large datasets, so we parallelize this
|
|
865
|
+
operation across multiple CPU cores.
|
|
866
|
+
|
|
867
|
+
|
|
861
868
|
Parameters
|
|
862
869
|
----------
|
|
863
870
|
freq : Union[str, pd.DateOffset]
|
|
@@ -867,6 +874,10 @@ class TimeSeriesDataFrame(pd.DataFrame):
|
|
|
867
874
|
Aggregation method applied to numeric columns.
|
|
868
875
|
agg_categorical : {"first", "last"}, default = "first"
|
|
869
876
|
Aggregation method applied to categorical columns.
|
|
877
|
+
num_cpus : int, default = -1
|
|
878
|
+
Number of CPU cores used when resampling in parallel. Set to -1 to use all cores.
|
|
879
|
+
chunk_size : int, default = 100
|
|
880
|
+
Number of time series in a chunk assigned to each parallel worker.
|
|
870
881
|
**kwargs
|
|
871
882
|
Additional keywords arguments that will be passed to ``pandas.DataFrameGroupBy.resample``.
|
|
872
883
|
|
|
@@ -928,7 +939,8 @@ class TimeSeriesDataFrame(pd.DataFrame):
|
|
|
928
939
|
0 2020-12-31 10.0
|
|
929
940
|
2021-12-31 26.0
|
|
930
941
|
"""
|
|
931
|
-
|
|
942
|
+
offset = pd.tseries.frequencies.to_offset(freq)
|
|
943
|
+
if self.freq == offset.freqstr:
|
|
932
944
|
return self
|
|
933
945
|
|
|
934
946
|
# We need to aggregate categorical columns separately because .agg("mean") deletes all non-numeric columns
|
|
@@ -939,9 +951,23 @@ class TimeSeriesDataFrame(pd.DataFrame):
|
|
|
939
951
|
else:
|
|
940
952
|
aggregation[col] = agg_categorical
|
|
941
953
|
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
954
|
+
def split_into_chunks(iterable: Iterable, size: int) -> Iterable[Iterable]:
|
|
955
|
+
# Based on https://stackoverflow.com/a/22045226/5497447
|
|
956
|
+
iterable = iter(iterable)
|
|
957
|
+
return iter(lambda: tuple(islice(iterable, size)), ())
|
|
958
|
+
|
|
959
|
+
def resample_chunk(chunk: Iterable[Tuple[str, pd.DataFrame]]) -> pd.DataFrame:
|
|
960
|
+
resampled_dfs = []
|
|
961
|
+
for item_id, df in chunk:
|
|
962
|
+
resampled_df = df.resample(offset, level=TIMESTAMP, **kwargs).agg(aggregation)
|
|
963
|
+
resampled_dfs.append(pd.concat({item_id: resampled_df}, names=[ITEMID]))
|
|
964
|
+
return pd.concat(resampled_dfs)
|
|
965
|
+
|
|
966
|
+
# Resampling time for 1 item < overhead time for a single parallel job. Therefore, we group items into chunks
|
|
967
|
+
# so that the speedup from parallelization isn't dominated by the communication costs.
|
|
968
|
+
chunks = split_into_chunks(pd.DataFrame(self).groupby(level=ITEMID, sort=False), chunk_size)
|
|
969
|
+
resampled_chunks = Parallel(n_jobs=num_cpus)(delayed(resample_chunk)(chunk) for chunk in chunks)
|
|
970
|
+
resampled_df = TimeSeriesDataFrame(pd.concat(resampled_chunks))
|
|
945
971
|
resampled_df.static_features = self.static_features
|
|
946
972
|
return resampled_df
|
|
947
973
|
|
|
@@ -283,6 +283,7 @@ class AbstractGluonTSModel(AbstractTimeSeriesModel):
|
|
|
283
283
|
init_args = self._get_estimator_init_args()
|
|
284
284
|
|
|
285
285
|
default_trainer_kwargs = {
|
|
286
|
+
"limit_val_batches": 3,
|
|
286
287
|
"max_epochs": init_args["max_epochs"],
|
|
287
288
|
"callbacks": init_args["callbacks"],
|
|
288
289
|
"enable_progress_bar": False,
|
|
@@ -14,9 +14,9 @@ utilsforecast<0.0.11,>=0.0.10
|
|
|
14
14
|
tqdm<5,>=4.38
|
|
15
15
|
orjson~=3.9
|
|
16
16
|
tensorboard<3,>=2.9
|
|
17
|
-
autogluon.core[raytune]==1.0.
|
|
18
|
-
autogluon.common==1.0.
|
|
19
|
-
autogluon.tabular[catboost,lightgbm,xgboost]==1.0.
|
|
17
|
+
autogluon.core[raytune]==1.0.0b20231125
|
|
18
|
+
autogluon.common==1.0.0b20231125
|
|
19
|
+
autogluon.tabular[catboost,lightgbm,xgboost]==1.0.0b20231125
|
|
20
20
|
|
|
21
21
|
[all]
|
|
22
22
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|