facebook / facebook/prophet

Optimizing the training result

Open
#2,545 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
20.4k
Forks
4.6k
Avg merge
19h 52m
Merged PRs (30d)
1

Description

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](https://github.com/facebook/prophet/assets/105078009/e0b4d3a0-b797-4dda-8179-138a2806d9ec)

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](https://github.com/facebook/prophet/assets/105078009/9ff78d8b-f376-4a09-ace0-1a51d4d9726c)

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](https://github.com/facebook/prophet/assets/105078009/87427385-a212-498f-b273-b889e3d56602)

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

I would appreciate any suggestions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.