time series forecasting using prophet model get error during run time

Registered Posts: 2

######## python and prophet version details

prophet version=1.1.4
python_version=3.9.12

I am using the same version in my local machine its working file. but i am facing error on DATAIKU

########### Code Sample ########

lag_periods = [1,5, 10, 15]

for lag in lag_periods:
df_prophet[f'Lag_{lag}'] = df_prophet['y'].shift(lag)

df_prophet['Rolling_Mean_7'] = df_prophet['y'].rolling(window=3).mean()
df_prophet['Rolling_Mean_14'] = df_prophet['y'].rolling(window=14).mean()
df_prophet['Rolling_Mean_30'] = df_prophet['y'].rolling(window=30).mean()

df_prophet['Exp_Moving_Avg_3'] = df_prophet['y'].ewm(span=3).mean()
df_prophet['Exp_Moving_Avg_7'] = df_prophet['y'].ewm(span=7).mean()

# Create trend features
df_prophet['Linear_Trend'] = df_prophet['y'].ewm(alpha=0.1).mean()
df_prophet['Quadratic_Trend'] = df_prophet['y'].ewm(alpha=0.1).mean().pow(2)
df_prophet['Exponential_Trend'] = df_prophet['y'].ewm(alpha=0.1).mean().ewm(alpha=0.1).mean()
df_prophet['Cubic_Trend'] = df_prophet['y'].ewm(alpha=0.5).mean().pow(3)

# Create outlier features
#df_prophet['Is_Outlier_Sale'] = df_prophet['y'].apply(lambda x: x > 3 * df['y'].std())


# Create rate of change feature
df_prophet['Rate_of_Change'] = df_prophet['y'].pct_change() * 100


# Initialize and fit Prophet model
prophet_model = Prophet( seasonality_prior_scale=0.05, changepoint_prior_scale=0.2,
yearly_seasonality=True, weekly_seasonality=True, daily_seasonality=True)
prophet_model.add_seasonality(name='monthly', period=30.44, fourier_order=4) # Capturing monthly seasonality
prophet_model.add_country_holidays(country_name='SA')

# Fit the model
prophet_model.fit(df_prophet)

#############################

RuntimeError: Error during optimization! Command '/dataiku/Data_dir_design/code-envs/python/Py39/lib/python3.9/site-packages/prophet/stan_model/prophet_model.bin random seed=91535 data file=/tmp/tmpnvp6v2uv/tvj8jixl.json init=/tmp/tmpnvp6v2uv/czt0d5ix.json output file=/tmp/tmpnvp6v2uv/prophet_modelc9a_94m7/prophet_model-20230919112247.csv method=optimize algorithm=newton iter=10000' failed:

Answers

  • Dataiker, Alpha Tester Posts: 196 Dataiker
    Hi,
    It seems the error message was cut off where the details were about to be given. See the end of the error message, that says in essence "the process failed:" and then cuts off. Pasting the rest of the error message would help.
  • Registered Posts: 2

    finally, i found the solution. The current model support on below configuration

    #prophet==1.1.1, holidays==0.18.0 ,python 3.8.13, Linux

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.