Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Where to pass regressor using add_regressor function? #709
I'm having great difficulty using the add_regressor function. I have a dataframe that looks like this:
There are values for the ad_spend column that go into the future. When I run this:
REGIONS = ['UK','DE','FR','NL']
I keep getting this error:
ValueError Traceback (most recent call last)
/Users/seanlynch/anaconda2/lib/python2.7/site-packages/fbprophet/forecaster.pyc in predict(self, df)
/Users/seanlynch/anaconda2/lib/python2.7/site-packages/fbprophet/forecaster.pyc in setup_dataframe(self, df, initialize_scales)
ValueError: Regressor "ad_spend" missing from dataframe
I'm unclear where I'm supposed to be putting the ad_spend column. Any help would be much appreciated?
It's in the line
You need to know the extra regressor both in the past (
where you would have to decide how to get your future values for ad_spend.
The error messaging can probably be improved here to make it more clear that it is
@bletham Thanks for that. Still not completely sure what I'm supposed to do here. Do I pass the historic ad spend data in the same dataframe with the columns 'y' and 'ds' and then pass the predicted future ad_spend in a separate dataframe. Or do I pass the all the ad_spend and future predicted ad_spend in a separate dataframe?
The first one is correct; you pass the historic ad spend to fit in the same dataframe as