I want to get results for only working days to get the Prophet forecast data

Asked 2 years ago, Updated 2 years ago, 232 views

Based on the sales data for 3 years, I would like to make a sales forecast by the end of 2021 through Prophet this year.
I was able to capture CSV data, create graphs, and output data to Excel.
The most recent test performance data you have captured is only on working days and does not include non-working days.

The data columns are as follows:

ds—Uptime YYYY-MM-DD
 y—Sales

The forecast output to Excel is for all days until the end of the year, including non-working days every month.Please let me know if there is a way to reflect only the working days in the forecast or exclude non-working days from the forecast.
I would appreciate it if you could let me know if there are any other suitable libraries.

python

2022-09-30 21:59

2 Answers

The Profet algorithm page contains the

Prophet is especially useful for data sets such as:
·Includes detailed historical observations (every hour, daily, weekly) over a long period of time (monthly, annual)
·Multiple strong seasonality
·Includes previously recognized, important but irregular events
·No data points or large missing values
·There is a nonlinear growth trend approaching the limit

From this point of view, it is considered appropriate that the actual data used for the analysis should be daily sales, including non-working days.
Why don't you add zero sales for non-working days (days not included in the test results data) to the test results data and use date-sorted data to predict?

Prophet seems to use a Fourier analysis method, so continuous input values (performance data to be analyzed) should be desirable.

I think it's honest to get a year's worth of data prediction from one year's worth of data (365 days).
Also, I think it is reasonable to assume that there will be no sales on non-working days.


2022-09-30 21:59

The following page is in English, but I think it will answer this question.

How to exclude weeks (Saturday & Sundays) from fb Prophet Issue#1291 ·facebook/profet

This will discard the weekend date in df:

df_no_weekdays=df['ds'].dt.dayofweek<5]
# For example:
# m = Profit()
# m.fit(df_no_weekdays)

The following pages may also help you solve the problem.

Eliminate weeks?·Issue#323·facebook/profet

This only creates a forecast date for business days:

horizon=200
future=m.make_future_dataframe(
    periods=horizon, 
    freq = 'B'
)

'B': Every business day (Monday - Friday)

(I'm sorry, but my native language is English.)


2022-09-30 21:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.