Skip to content
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

Prophet/forecaster.py:1789: RuntimeWarning: overflow encountered in exp #2647

Open
MattiaPeiretti opened this issue Jan 5, 2025 · 1 comment

Comments

@MattiaPeiretti
Copy link

Hello, I am experiencing this issue while running prophet and scaling data. It also makes prophet significantly slower when data is scaled between floor and cap. About 10x slower.

prophet/forecaster.py:1789: RuntimeWarning: overflow encountered in exp
  sample_trends = cap / (1 + np.exp(-k_t * (t_time - m_t)))

Together with this I also get the following:

Optimization terminated abnormally. Falling back to Newton.

If I run prophet without scaling the data, I do not get these warnings.

Scaling data:

model_data['y_scaled'] = (model_data['y'] - model_data['floor']) / (model_data['cap'] - model_data['floor'])
model_data_scaled = model_data[['ds', 'y_scaled']].rename(columns={'y_scaled': 'y'})
model_data_scaled['cap'] = model_data['y'].max() * 2
model_data_scaled['floor'] = 0

model.fit(model_data_scaled)

What data is this about?

We're forecasting bank balances per day. Horizon is 90 days.

Prophet settings:
ModelType is logistic

The rest of the settings are tried in different combinations, but even with everything left to default, the problem still manifests itself.

Thanks in advance!

@imad24
Copy link
Contributor

imad24 commented Jan 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants