给定一组每日销售额,如何预测未来的“每周”销售额?销售量?

发布于 2025-01-17 04:27:50 字数 436 浏览 4 评论 0原文

我有一个公司每日销售额的数据集。这些列包括:类别代码(4 个类别)、商品代码(195 个商品)、日期 ID(2021 年 9 月 1 日至 2022 年 2 月 1 日)、每日销售数量。

在验证集和测试集中,我必须预测从 2022 年 2 月 14 日到 2022 年 3 月 13 日的每周销售额。列是类别代码、商品代码、周数(w1、w2、w3、w4)。在验证集中,我有每周销售数量,而在测试集中,我必须预测每周销售数量。

因为我的火车组有每日销售量并且没有周数,所以我对如何解决这个问题感到困惑。我没有他们在验证集和测试集中给出的月份销售的历史数据。

我是否应该将火车中的天数映射为每个月的周 w1、w2、w3、w4?还有其他好的方法吗?

我尝试通过将每周销售额除以 7 并用该周每天的 7 个新行替换一周行来扩展 val 集,但这给了我非常糟糕的结果。

我必须使用 MAPE 指标。

I have a dataset with daily sales in a company. The columns are, category codes (4 categories), item code (195 items), day ID (from 1st Sep 2021 - 1st Feb 2022), Daily sales in qty.

In val and test sets, I have to predict WEEKLY sales from 14th Feb 2022 - to 13th March 2022. Columns are category codes, item code, week numbers (w1, w2, w3, w4). In the val set, I have weekly sales in qty, and in the test set, I have to predict weekly sales in qty.

Because my train set has DAILY sales and no week number, I am confused about how to approach this problem. I don't have historical data on sales of months they have given in val and test sets.

Should I map days in the train set to weeks as w1, w2, w3, w4 for each month? Are there any other good methods?

I tried expanding val set by dividing weekly sales by 7 and replacing a week row with 7 new rows for each day in that week, but it gave me very bad resutls.

I have to use the MAPE metric.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

勿忘心安 2025-01-24 04:27:50

欢迎来到社区!

由于要求您每周进行预测,因此最好将训练数据转换为几周。

pandas 的一个方法是 resample(),您可以在文档中了解更多信息 此处。您可以将偏移字符串更改为与构建验证集的方式相匹配的偏移字符串。所有可用的选择都可以在此处找到。

您可能会发现也很有用。

Welcome to the community!

Since you are asked to predict on a weekly basis, then it is better to transform your training data to weeks.

A pandas method for this is resample(), you can learn more about it in the documentation here. You can change the offset string to the one that you need to match the way in which the validation set was built. All the available choices can be found here.

You may find this useful too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文