facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.55k stars 4.54k forks source link

Number of dimensions of param "k" changes if the input timeseries is single-valued #2612

Open felipeangelimvieira opened 3 months ago

felipeangelimvieira commented 3 months ago

When using Prophet with sktime, it was detected that the parameter k has a single dimension when the timeseries is constant, otherwise has two dimensions, which could be an unexpected behaviour.

Code to reproduce:

import pandas as pd
from sktime.forecasting.fbprophet import Prophet 

y  = pd.DataFrame(index=pd.period_range(start="2022-01", periods=18, freq="Q"),
             data={"value": 0})
# By removing the comment from the line below
# the error disappears
#y.iloc[-1] = 1

forecaster = Prophet(freq="Q").fit(y)
forecaster.get_fitted_params()

Related issue sktime/sktime#6982