Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loaders for M5 & ETT datasets #3155

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/gluonts/dataset/repository/_ett_small.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@ def generate_ett_small_dataset(
dfs.append(df)

test = []
for df in dfs:
for region, df in enumerate(dfs):
start = pd.Period(df["date"][0], freq=freq)
for col in df.columns:
if col in ["date"]:
continue
test.append(
{
"start": start,
"item_id": col,
"item_id": f"{col}_{region}",
"target": df[col].values,
}
)

train = []
for df in dfs:
for region, df in enumerate(dfs):
start = pd.Period(df["date"][0], freq=freq)
for col in df.columns:
if col in ["date"]:
continue
train.append(
{
"start": start,
"item_id": col,
"item_id": f"{col}_{region}",
"target": df[col].values[:-prediction_length],
}
)
Expand Down
6 changes: 5 additions & 1 deletion src/gluonts/dataset/repository/_m5.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def generate_m5_dataset(
]

# Build target series
train_ids = sales_train_validation["item_id"]
train_ids = (
sales_train_validation["item_id"].str
+ "_"
+ sales_train_validation["store_id"].str
)
train_df = sales_train_validation.drop(
["id", "item_id", "dept_id", "cat_id", "store_id", "state_id"],
axis=1,
Expand Down
3 changes: 2 additions & 1 deletion src/gluonts/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
character if set to `True`.
"""

__all__ = [ # noqa
# ruff: noqa: F822
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New ruff version complains about this, requires a fix

__all__ = [
"variant",
"dump",
"dumps",
Expand Down
Loading