0

I am new to timeseries analysis and was trying to fit my data into the fb prophet model using the holidays parameter but It was giving a key error on a date which doesn't exist. On renaming the whole holidays column to some other name like super it is fitting but the same code is running on my collegues laptops. Please suggest me a fix to this problem. it is fitting without the holidays parameter.

I've tried reinstalling python on my conda env. I've tried running it on a different IDE. I've updated conda as well

df_holidays_events = pd.read_csv('holidays.csv')

df_holidays = df_holidays_events[['event', 'Date']]

df_holidays.columns = ['holiday', 'ds']

df_holidays.ds = pd.to_datetime(df_holidays.ds)

from fbprophet import Prophet
m = Prophet(changepoint_prior_scale=2.5, holidays=df_holidays)
m.fit(x_train)

This is how x_train looks like

DAY month   week    year    ds  y
date                        
2011-01-30  6   1   4   2011    2011-01-30  481
2011-01-31  0   1   5   2011    2011-01-31  522

This is the df_holidays data frame

        holiday         ds
0   4th of July     2012-07-04
1   Labor Day       2012-08-31

It should actually fit the model but it isn't fitting it.

anky
  • 74,114
  • 11
  • 41
  • 70

1 Answers1

1

The problem was apparently with pandas, I downgraded it to version 0.23.4 and it solves my issue. Hope this helps others