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 loader for the M5 dataset #3151

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Changes from all 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
7 changes: 5 additions & 2 deletions src/gluonts/dataset/repository/_m5.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def generate_m5_dataset(
"d",
],
axis=1,
errors="ignore",
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?

)
cal_features["event_type_1"] = cal_features["event_type_1"].apply(
lambda x: 0 if str(x) == "nan" else 1
Expand Down Expand Up @@ -112,9 +113,11 @@ def generate_m5_dataset(
]

# Build target series
train_ids = sales_train_validation["id"]
train_ids = sales_train_validation["item_id"]
train_df = sales_train_validation.drop(
["id", "item_id", "dept_id", "cat_id", "store_id", "state_id"], axis=1
["id", "item_id", "dept_id", "cat_id", "store_id", "state_id"],
axis=1,
errors="ignore",
)
test_target_values = train_df.values.copy()
train_target_values = [ts[:-prediction_length] for ts in train_df.values]
Expand Down
Loading