evalml icon indicating copy to clipboard operation
evalml copied to clipboard

Enhance Decomposer() with .get_seasonal_periodicty()

Open chukarsten opened this issue 3 years ago • 0 comments
trafficstars

Currently, the PolynomialDecomposer calls freq_to_period based on the time series frequency string stored in the DateTimeIndex of the target variable. This returns a periodicity integer which may not always reflect the actual periodicity of the signal.

For instance, if the target data has daily data, meaning each entry corresponds to a different day, then the freq_to_period function will return a periodicity of 7. When this gets passed into the seasonal_decompose, the result is that the moving average seasonality assumes that the seasonal component of the signal repeats every 7 values. If this is the case, then the function decomposes correctly. If not, then the decomposition is weird and wrong.

We can correct this in two steps:

  1. Make PolynomialDecomposer accept an integer period, reflecting that the user has identified the period manually. Then pass this value in and use it.
  2. Make the PolynomialDecomposer intelligently determine the period of the seasonal signal.

chukarsten avatar Sep 12 '22 18:09 chukarsten