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 item_id for M5 dataset #3156

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from 1 commit
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
11 changes: 6 additions & 5 deletions src/gluonts/dataset/repository/_m5.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,17 @@ def generate_m5_dataset(
len(state_ids_un),
]

# Build target series
train_ids = (
sales_train_validation["item_id"].str
# Compute unique ID in case `id` column is missing
sales_train_validation["id"] = (
abdulfatir marked this conversation as resolved.
Show resolved Hide resolved
sales_train_validation["item_id"].astype("str")
+ "_"
+ sales_train_validation["store_id"].str
+ sales_train_validation["store_id"].astype("str")
)
# Build target series
train_ids = sales_train_validation["id"]
train_df = sales_train_validation.drop(
["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