ourownstory / neural_prophet

NeuralProphet: A simple forecasting package
https://neuralprophet.com
MIT License
3.83k stars 473 forks source link

Unexpected Side Effect When Running make_future_dataframe #1650

Open tbj128 opened 1 week ago

tbj128 commented 1 week ago

The function make_future_dataframe() calls _check_dataframe(...) here which then calls df_utils.check_dataframe(...). This latter method returns lag_regressors_to_remove as part of the response which _check_dataframe(...) then uses to remove lagged regressors from the model here.

However, what this means is that if during inference a dataframe is passed to make_future_dataframe() has a regressor that is completely the same value, the model itself is unexpected mutated. Subsequent calls to the predict function will fail or have unexpected behavior because the model no longer knows about the lagged regressors.

I'm not sure if this was intended, but it's a confusing side effect of calling make_future_dataframe() - perhaps there should be a check so that the model regressors are not touched when calling this dataframe?