8000 [BUG] Prophet model with specific configuration stuck during fit · Issue #8271 · sktime/sktime · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BUG] Prophet model with specific configuration stuck during fit #8271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
naive-forecaster opened this issue May 20, 2025 · 5 comments
Open
Labels
bug Something isn't working module:forecasting forecasting module: forecasting, incl probabilistic and hierarchical forecasting

Comments

@naive-forecaster
Copy link

Describe the bug

When running Prophet through optuna, a specific value for one parameter has caused the fit of the model to freeze. It stays there indefinitely.

To Reproduce

from sktime.forecasting.fbprophet import Prophet
import pandas as pd

values = [2660.351318359375, 2967.0, 2098.0, 3950.983642578125, 1792.0, 2630.22705078125, 2883.9990234375, 5061.98193359375, 1218.0, 2810.0, 4130.0, 3012.0, 4482.0, 6132.0, 5349.189453125, 6200.0, 6288.0, 1e-05, 1e-05, 1e-05, 1e-05, -69.733154296875, 1e-05, 1e-05, 4420.0, 4172.0, 1e-05, 1e-05, 2970.534912109375, 3888.0, 1e-05, 1825.0, 1e-05, 6164.0, 1e-05, 1e-05, 1e-05, 8766.0, 8630.0, 6026.0, 8056.0, 9312.0, 5970.82861328125, 6828.6240234375, 6324.98193359375, 6478.0, 7568.0, 8166.0, 8426.0, 6566.0, 9364.0, 9134.0, 5674.82958984375, 8979.0, 8716.0, 5914.85498046875, 7718.0, 6452.5673828125, 6677.4462890625, 7114.0, 5114.0, 4248.0, 3800.0, 4000.0, 2424.0, 2946.0, 4294.0, 4496.0, 3992.0, 3360.0, 4738.0, 2696.0, 2466.266845703125, 1416.0, 1260.0, 4262.0, 6538.0, 5444.0, 5216.0, 5716.0, 5294.0, 4768.0, 3298.0, 1e-05, 884.0, 4474.0, 4280.0, 3136.0, 4136.0, 2838.0, 4402.0, 6146.0, 1354.0, 1e-05, 6868.13818359375, 5391.9150390625, 2792.981689453125, 2192.0, 1e-05, 694.2969970703125]
data = pd.DataFrame(values, columns=['y'])
data.index = pd.date_range(start='2023-01-01', periods=len(values), freq='W')

model = Prophet(changepoint_prior_scale=0.4698311734933264, verbose=True)
model.fit(y=data, X=None)

Expected behavior

The fit call to finish.

Additional context

I observed it getting stuck for the passed series only for weekly frequencies. It worked fine for day and month frequencies.

Modifying the series (adding constants or cropping) makes the fit call work, but multiplying it by a constant does not.

I have tried using the Newton algorithm and the call ends correctly, but I would rather use the default for performance.

Using a different value of changepoint_prior_scale, even by modifying the last decimal to 0.4698311734933265 makes it work, but I cannot control the values chosen by optuna.

Versions
sktime==0.34.0
prophet==1.1.6
cmdstanpy==1.1.0

System:
python: 3.11.0 (main, Dec 6 2022, 13:17:12) [GCC 10.2.1 20210110]
executable: /usr/local/bin/python
machine: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31

Python dependencies:
pip: 24.3.1
sktime: 0.34.0
sklearn: 1.5.2
skbase: 0.11.0
numpy: 1.26.4
scipy: 1.11.4
pandas: 2.2.3
matplotlib: 3.10.3
joblib: 1.4.2
numba: 0.61.2
statsmodels: 0.14.4
pmdarima: 2.0.4
statsforecast: 2.0.0
tsfresh: None
tslearn: 0.6.3
torch: 2.3.1
tensorflow: None

@naive-forecaster naive-forecaster added the bug Something isn't working label May 20, 2025
8000
@github-project-automation github-project-automation bot moved this to Needs triage & validation in Bugfixing May 20, 2025
@felipeangelimvieira
Copy link
Contributor

Hello @naive-forecaster. I tried reproducing the code in my machine (MacOS) but it did work here. This bug smells like something about the backend, but even after forcing cmdstanpy to be the same as yours I could obtain the model here.

Could you provide another code so I can try reproduce it again?

@felipeangelimvieira
Copy link
Contributor

obs: could it be related to WSL2?

@fkiraly fkiraly added the module:forecasting forecasting module: forecasting, incl probabilistic and hierarchical forecasting label May 21, 2025
@fkiraly
Copy link
Collaborator
fkiraly commented May 21, 2025

Off-topic, but I congratulate you to a brilliant choice of user name, @naive-forecaster

@naive-forecaster
Copy link
Author

@felipeangelimvieira I could reproduce the issue both locally (WSL2) and in a cloud instance.

I cannot currently provide another example because I stumbled into this particular one by chance.

@fkiraly
Copy link
Collaborator
fkiraly commented May 22, 2025

I cannot currently provide another example because I stumbled into this particular one by chance.

Random thought, usually something like this might happen if the sequence is in some respect low-rank, e.g., zero residuals after deseasonalisation or similar.

Though I cannot spot any clear pattern here. Maybe if you translate the numbers to ASCII codes, it spells out a passage from the Ars Goetia?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module:forecasting forecasting module: forecasting, incl probabilistic and hierarchical forecasting
Projects
Status: Needs triage & validation
Development

No branches or pull requests

3 participants
0