# How to use categorical data in forecasting with Prophet?

I'm trying to create a model to predict the number of players on a video game at a certain time and was trying to figure out how to integrate categorical data into my forecasting problem. So far, my plan is to use the Steam player count data to train Facebook's Prophet to predict the player numbers. I'm trying to figure out how I can use categorical data, such as if the game is free, to affect this, along with trying to compare with other games. I found out that Prophet has an extra_regressor method that will take an additional time series, predict it, then use that prediction for the main prediction. The problem is, if I tried to use the categories for this, their encodings would be constant and thus useless, and I'm also not comparing across games. Does anybody have any suggestions for how to use this categorical data? Thanks!

Not sure if you can predict with many categories.

Nevertheless, some categories could be transformed into numbers that would ease the predictions. For instance, the cost could be converted into 0: Totally Free, 1: Free with pass, 2: less than 10USD, 3: less than 30USD, etc.

(Or just use the average money spent on the game per player, if you have it)

And you can also apply the "other factors" option:

# Python
m = Prophet(weekly_seasonality=False)

future['on_season'] = future['ds'].apply(is_nfl_season)
future['off_season'] = ~future['ds'].apply(is_nfl_season)
forecast = m.fit(df).predict(future)
fig = m.plot_components(forecast)


Or other regressor:

# Python
def nfl_sunday(ds):
date = pd.to_datetime(ds)
if date.weekday() == 6 and (date.month > 8 or date.month < 2):
return 1
else:
return 0
df['nfl_sunday'] = df['ds'].apply(nfl_sunday)

m = Prophet()