Home > Net >  Given a set of daily sales, how to predict future 'Weekly' sales?
Given a set of daily sales, how to predict future 'Weekly' sales?

Time:03-28

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.

CodePudding user response:

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.

  • Related