prophet icon indicating copy to clipboard operation
prophet copied to clipboard

Does Prophet require feature engineering for regressors?

Open carlosg-m opened this issue 1 year ago • 2 comments

When applying Linear Regression or Autoreg to a timeseries it is usually beneficial to create new features based on exogenous variables to extract temporal information, for example lags, moving averages and so on.

  1. Does Prophet require such a step or is there a mechanism in place to extract or account for temporal dependencies provided by regressors?
  2. Do we need to standardize regressors with z-score?
  3. Does Prophet have built-in feature selection for regressors?

carlosg-m avatar Aug 23 '23 11:08 carlosg-m

@AlexandroLuis please share some of your knowledge :)

carlosg-m avatar Aug 23 '23 15:08 carlosg-m

Hello @carlosg-m

  1. Prophet currently doesn't require you to manually build any features to account temporal seasonalities, instead it has a built-in mechanism to handle it, automatically detects seasonalities such as days, weeks and years, as well hollidays and events with no need for a feature engineering. Even if you are using regressors, prophet can handles the incorporation of exogenous variables and their temporal dependencies. Here's an example: 'regressor_1': [5, 8, 7, 9, 10] # exogenous variable model.add_regressor('regressor_1') # Add your exogenous variable to model Add regressor values for the future dates if i'ts known future['regressor_1'] = [11, 12, 13] I have specified the mode of seasonality, if i'ts a week and a year season and let the daily the default one, with is False.
  2. No, you don't need to normalize your regressor using z-scores, prophet currently does that for you.
  3. No, i't currently doesn't have a built-in feature selection for regressors, you'll need to do it manually. You could use SelectKBest from scikit-learn with the f_regression scoring, so can find the top 1 regressor.

AlexandroLuis avatar Sep 05 '23 12:09 AlexandroLuis