facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.01k stars 4.48k forks source link

Optimizing the training result #2545

Open hadis-h opened 5 months ago

hadis-h commented 5 months ago

I am new in time-series forecasting with Prophet, Currently, I am doing forecasting for the number of sales, I don't get really good results with Prophet, my dataset doesn't have a specific trend and has random spikes:

Figure_1

Here is the result of my training and testing, I am getting very high errors in testing, I tried to give the spike as a holiday, the blue line is the training result, the black line is the measurement, the yellow line is the testing result and the green line is the actual data. Also, I add this to my model:

model = Prophet(changepoint_prior_scale=0.08, seasonality_prior_scale=0.6, weekly_seasonality=False, daily_seasonality=False, yearly_seasonality=True, seasonality_mode = "additive", holidays=holidays)

This is also the result for the components plot:

Figure_2

I have many questions and it would be great if help me figure out how can I improve my accuracy.

  1. The line of change points (red) is smooth, should I adjust the change points by myself ?, so the model works better because there are so many changing points that Prophet cannot detect.
  2. If the answer to the first question is yes! how can I do it? In the documentation, it is written, is better the model does it automatically, so I didn't change it.
  3. Does Prophet work well in these types of datasets which have randomly increasing and decreasing?

I want to have high accuracy as much as possible: This is my result for accuracy: cutoffs = pd.to_datetime(["2019-12"])

df_cv2 = cross_validation(model, cutoffs=cutoffs,horizon="365 days")

df_p = performance_metrics(df_cv2)

Screenshot 2024-01-16 at 16 24 14

The result of mse for testing is 398 which is extremely high.

I would appreciate any suggestions.