Skip to content

Commit

Permalink
fix more
Browse files Browse the repository at this point in the history
  • Loading branch information
lostella committed Feb 1, 2024
1 parent 0485c98 commit 7a879dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gluonts/mx/model/deepvar/_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ def __call__(self, index: pd.PeriodIndex) -> np.ndarray:
def time_features_from_frequency_str(freq_str: str) -> List[TimeFeature]:
features = {
"M": ["weekofyear"],
"ME": ["weekofyear"],
"W": ["daysinmonth", "weekofyear"],
"D": ["dayofweek"],
"B": ["dayofweek", "dayofyear"],
"H": ["hour", "dayofweek"],
"h": ["hour", "dayofweek"],
"min": ["minute", "hour", "dayofweek"],
"T": ["minute", "hour", "dayofweek"],
}
Expand All @@ -114,13 +116,13 @@ def get_lags_for_frequency(
) -> List[int]:
offset = to_offset(freq_str)

if offset.name == "M":
if offset.name in ["M", "ME"]:
lags = [[1, 12]]
elif offset.name == "D":
lags = [[1, 7, 14]]
elif offset.name == "B":
lags = [[1, 2]]
elif offset.name == "H":
elif offset.name in ["H", "h"]:
lags = [[1, 24, 168]]
elif offset.name in ("min", "T"):
lags = [[1, 4, 12, 24, 48]]
Expand Down

0 comments on commit 7a879dc

Please sign in to comment.