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.34k stars 4.52k forks source link

suggestion on filling nan using prophet #2183

Open rahul4tripathi2 opened 2 years ago

rahul4tripathi2 commented 2 years ago

Hi Team,

could you please suggest/advice recommended ways to fill nan in data?

Regards Rahul

winedarksea commented 2 years ago

In my experience forward fill of the data is the fastest and safest default method.

df['y'] = df['y'].fillna(method="ffill")

or you could use my AutoTS package with Prophet in the model_list and it will automatically try different FillNA methods to see what works best. 🥳

rahul4tripathi2 commented 2 years ago

thanks, but i tried ffill,bffill,interpolation my r2 score is decreasing so looking for existing prophet method

winedarksea commented 2 years ago

Prophet doesn't use a fill na method. The trend and fourier seasonalities are all able to be generated with NaN present in data because they are statistically sampled, and actually more reliant on 'ds' than on 'y' in many ways. The regression components (additional regressors, holidays, etc) will fail if NaN are present, and so need to be handled by the user.