Comments (4)
hi Borgna02. I had the same problem like you about the
self.stan_fit = self.model.optimize(**args)
I want to ask you how to handle this error if you already solve it
Hi, i solved it executing the script on ubuntu 22.04, prophet 1.1.1 and holidays 0.18.0.
I don't know if at the moment is possible to execute it on windows..
from prophet.
I'm also with the same problem... digging deeper into the logs I saw that this error is being raised in cmdstanpy backend.
RuntimeError: Error during optimization! Command '/home/victor/Projects/Infra/natto-forecaster/venv/lib/python3.9/site-packages/prophet/stan_model/prophet_model.bin random seed=99561 data file=/tmp/tmpdy1bc6ti/l6ubkhnj.json init=/tmp/tmpdy1bc6ti/5gzpegdq.json output file=/tmp/tmpdy1bc6ti/prophet_modelxvyk50xw/prophet_model-20231201112246.csv method=optimize algorithm=newton iter=10000' failed: console log output:
method = optimize
optimize
algorithm = newton
newton
jacobian = 0 (Default)
iter = 10000
save_iterations = 0 (Default)
id = 1 (Default)
data
file = /tmp/tmpdy1bc6ti/l6ubkhnj.json
init = /tmp/tmpdy1bc6ti/5gzpegdq.json
random
seed = 99561
output
file = /tmp/tmpdy1bc6ti/prophet_modelxvyk50xw/prophet_model-20231201112246.csv
diagnostic_file = (Default)
refresh = 100 (Default)
sig_figs = -1 (Default)
profile_file = profile.csv (Default)
num_threads = 1 (Default)
Rejecting initial value:
Error evaluating the log probability at the initial value.
Exception: normal_lpdf: Random variable is nan, but must be not nan! (in 'prophet.stan', line 130, column 2 to column 19)
Initialization between (-2, 2) failed after 1 attempts.
Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
Initialization failed.
I've already tried changing the parameters, specifying initial values and clearing Nan values but, since doesn't seem to be in Prophet initialization, any of them worked. My code if needed:
# Create a new Prophet model with the loaded parameters
prophet_model = Prophet(**model)
# Fit the model with the data
df_for_prophet = data[["DTNEG", "QTDNEG"]].rename(
columns={"DTNEG": "ds", "QTDNEG": "y"}
)
# Convert 'y' column to numeric, coercing errors
df_for_prophet["y"] = pd.to_numeric(df_for_prophet["y"], errors="coerce")
# Drop rows with NaN values after conversion
df_for_prophet = df_for_prophet.dropna(subset=["y"])
# Set options to display more rows and columns
pd.set_option("display.max_rows", None)
pd.set_option("display.max_columns", None)
# print(
# {
# "pickle_parameters": {**model},
# "Loaded Prophet model for product": product,
# "model_name": model_name,
# "df": df_for_prophet,
# }
# )
prophet_model.fit(df_for_prophet) # error is being raised inside this function
# Reset display options to default values
pd.reset_option("display.max_rows")
pd.reset_option("display.max_columns")
Thanks in advance
from prophet.
Same problem, prophet 1.1.5:
16:35:26 - cmdstanpy - INFO - Chain [1] start processing
16:35:26 - cmdstanpy - INFO - Chain [1] done processing
16:35:26 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 3221225657
Optimization terminated abnormally. Falling back to Newton.
16:35:27 - cmdstanpy - INFO - Chain [1] start processing
16:35:27 - cmdstanpy - INFO - Chain [1] done processing
16:35:27 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 3221225657
Traceback (most recent call last):
File "C:\Users\danyb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\prophet\models.py", line 121, in fit
self.stan_fit = self.model.optimize(**args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\danyb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\cmdstanpy\model.py", line 659, in optimize
raise RuntimeError(msg)
RuntimeError: Error during optimization! Command 'C:\Users\danyb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\prophet\stan_model\prophet_model.bin random seed=82529 data file=C:\Users\danyb\AppData\Local\Temp\tmpz_z9dcxk\chl1mqe7.json init=C:\Users\danyb\AppData\Local\Temp\tmpz_z9dcxk\cfjxi_pi.json output file=C:\Users\danyb\AppData\Local\Temp\tmpz_z9dcxk\prophet_modelq8hb3fxt\prophet_model-20240421163526.csv method=optimize algorithm=lbfgs iter=10000' failed:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\Uni\3 anno\1 sem\AI\progetti_corso_AI\progetto_finale\src\fbprophet\fbprhphet_prova.py", line 73, in
model.fit(future_df.reset_index().rename(columns={'index': 'ds', 'daily_return_NVDA': 'y'}))
File "C:\Users\danyb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\prophet\forecaster.py", line 1232, in fit
self.params = self.stan_backend.fit(stan_init, dat, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\danyb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\prophet\models.py", line 128, in fit
self.stan_fit = self.model.optimize(**args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\danyb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\cmdstanpy\model.py", line 659, in optimize
raise RuntimeError(msg)
RuntimeError: Error during optimization! Command 'C:\Users\danyb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\prophet\stan_model\prophet_model.bin random seed=9043 data file=C:\Users\danyb\AppData\Local\Temp\tmpz_z9dcxk\s2v4x2tf.json init=C:\Users\danyb\AppData\Local\Temp\tmpz_z9dcxk\8u4b2w1y.json output file=C:\Users\danyb\AppData\Local\Temp\tmpz_z9dcxk\prophet_modelqfm1twda\prophet_model-20240421163527.csv method=optimize algorithm=newton iter=10000' failed:
from prophet.
hi Borgna02. I had the same problem like you about the
self.stan_fit = self.model.optimize(**args)
I want to ask you how to handle this error if you already solve it
from prophet.
Related Issues (20)
- prophet.serialize FutureWarning: The behavior of Timestamp.utcfromtimestamp is deprecated...
- Seeking clarification on setting custom holiday prior scale HOT 2
- Schedule retrain an existing prophet model HOT 6
- New Forecasts on existing data different than original forecast.
- Problem with turtle andy pygame
- python: can't open file '/home/chris/cupp.py': [Errno 2] No such file or directory
- cant install fbprophet using pip install fbprophet HOT 2
- change cost function to Sum of square error
- Numpy dependency version needs to be bumped to 1.20.x for numpy.typing
- Weekend predictions and holidays on high frequency daily data
- I have a issue in installation of prophet library HOT 2
- error in pip install pystan, cython was installed, does anyone know how to solve it?
- Fit params for kwargs
- fbprophet installing error HOT 1
- RuntimeError: Error during optimization: console log output: dyld[10867]: Symbol not found
- pip install guardrails getting this error HOT 2
- Prophet Training Speed: Intel vs Apple M1/M2
- RuntimeError: Error during optimization! HOT 1
- fbprophet install error fix
- BUG - Cannot predict on using logistic -> All-NaN slice encountered
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prophet.