Skip to content

seasonality

add_calendar_effects(attrs, as_dummies=False)

Extract calendar effects from time column, returns calendar effects as categorical columns.

Parameters:

Name Type Description Default
attrs list of str

List of calendar effects to be applied to the time column:

  • "minute"
  • "hour"
  • "day"
  • "weekday"
  • "week"
  • "month"
  • "quarter"
  • "year"
required
as_dummies bool

Returns calendar effects as columns of one-hot-encoded dummies.

False

add_fourier_terms(sp, K)

Fourier features for time series seasonality.

Fourier Series terms can be used as explanatory variables for the cases of multiple seasonal periods and or complex / long seasonal periods.

The implementation is based on the Fourier function from the R forecast package.

Parameters:

Name Type Description Default
sp int

Seasonal period.

required
K int

Maximum order(s) of Fourier terms. Must be less than sp.

required

add_holiday_effects(country_codes, as_dummies=False)

Extract holiday effects from time column for specified ISO-2 country codes and frequency.

Parameters:

Name Type Description Default
country_codes List[str]

A list of ISO-2 country codes.

required
as_dummies bool

Returns calendar effects as columns of one-hot-encoded dummies.

False