Prophet/forecaster.py:1789: RuntimeWarning: overflow encountered in exp
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- numpy, python
- Domain
- data, machine-learning
Research direction
Reproduce the report with logistic growth and scaled data, then inspect prophet/forecaster.py around line 1789, especially the np.exp call and the optimization fallback. Done means the scaled-data case no longer emits the overflow warning or incurs the reported slowdown, while forecasting remains correct.
Written by the indexing model from the issue text.
Description
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!
- Dominant language
- Python
- Stars
- 20.5k
- Forks
- 4.6k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from facebook/prophet
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Linux x86-64 wheel: overlapping ELF load pages in prophet_model.bin on Linux 4.18 kernelsPossibly taken @nicolasdalsass claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
make_future_dataframe returns 1970 dates when `ds` is an integer columnPossibly taken @k0nnect claimed this 11 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
model_to_json drops the fitted regressor predictor; deserialized model can't predictPossibly taken @caiotheodoro claimed this 11 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
plot_components fails for logistic models with minmax scaling and no floorPossibly taken @RaphaelFakhri claimed this 38 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
All issues in facebook/prophet
Similar issues
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorPossibly taken @jejjohnson claimed this today. Opentype:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jejjohnson/integrix#144 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
finos/ai-governance-framework#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days
-
type/bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
h2oai/h2o-llmstudio#1163 ·
Maintainers usually reply within 1 day