Neural prophet - Make future dataframe doesn't take 'freq' parameter #1598
Unanswered
lakshmi2688
asked this question in
Q&A - get help using NeuralProphet
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Creating something like future_df = model.make_future_dataframe(periods=50, freq="W-SUN") works in Prophet works, but not in Neural prophet. I need to be able to create a future dataframe of weekly frequency (neural prophet by default creates future dataframe of daily frequency)
future_df = model.make_future_dataframe(periods=50, freq="W-SUN") in NeuralProphet throws error 'TypeError: NeuralProphet.make_future_dataframe() got an unexpected keyword argument 'freq''
df=train_fp.copy()
print(df)
params = dict(
growth='off',
yearly_seasonality=True,
weekly_seasonality=False,
daily_seasonality=False,
batch_size=64,
epochs=200,
learning_rate=0.03)
m = NeuralProphet(**params,quantiles=[0.90, 0.10]) if params is not None else NeuralProphet()
m.set_plotting_backend("plotly-static")
future_np = m.make_future_dataframe(df, periods=61*5)
print(future_np)
expectation: dataframe future_np should have W-SUN frequency (since df has weekly frequency)
actuals : dataframe future_np has daily frequency. If freq argument is included in make_future_dataframe, for example: future_df = model.make_future_dataframe(periods=50, freq="W-SUN"), NeuralProphet throws error 'TypeError: NeuralProphet.make_future_dataframe() got an unexpected keyword argument 'freq'
Actual output looks like below
INFO - (NP.df_utils._infer_frequency) - Major frequency W-SUN corresponds to 99.363% of the data.
INFO - (NP.df_utils._infer_frequency) - Dataframe freq automatically defined as W-SUN
INFO - (NP.df_utils.return_df_in_original_format) - Returning df with no ID column
ds y
0 2019-12-29 12424.0
1 2020-01-05 20213.0
2 2020-01-12 22507.0
3 2020-01-19 18660.0
4 2020-01-26 18155.0
.. ... ...
152 2022-11-27 332487.0
153 2022-12-04 144574.0
154 2022-12-11 179180.0
155 2022-12-18 114382.0
156 2022-12-25 60278.0
[157 rows x 2 columns]
ds y
0 2022-12-26 None
1 2022-12-27 None
2 2022-12-28 None
3 2022-12-29 None
4 2022-12-30 None
.. ... ...
300 2023-10-22 None
301 2023-10-23 None
302 2023-10-24 None
303 2023-10-25 None
304 2023-10-26 None
[305 rows x 2 columns]
Beta Was this translation helpful? Give feedback.
All reactions