Facebook prophet: understanding if a non binary regressor is having any impact

Viewed 18

I want to use the Facebook prophet to predict how much of our product we are going to sell on a given day. I know that a big indicator of how much we sell is how much money we have spent on advertising in the few days before it. So my training data looks like the below. where y is the number of products we sold on a given day.

ds,y,daily_advertising_spend
2022-03-26 00:00:00,5000,10
2022-03-29 00:00:00,5300,30
2022-03-31 00:00:00,5700,50
2022-04-01 00:00:00,6000,10

I have the following code to create the model:

m = Prophet()
m.add_country_holidays(country_name='UK')
m.add_regressor("daily_advertising_spend")
m.fit(df)

future = m.make_future_dataframe(periods=10)
future["daily_advertising_spend"] = 10

forecast = m.predict(future)    

plot_plotly(m, forecast).show()
m.plot_components(forecast).show()

The model fits the data pretty well. But where it does really bad is when we had big marketing spend. For example reasonably close to the start we can see that the model massively underpredicts a few points which are when our advertising spend was quite high.

I don't think that prophet is acknowledging this regressor. How can I check if it is acknowledging it? I have also included the regressor components chart which I can't make sense of. What does -5.3 indicate on that chart?

enter image description here

enter image description here

0 Answers
Related