evalml
evalml copied to clipboard
Enhance Decomposer() with .get_seasonal_periodicty()
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:
- Make PolynomialDecomposer accept an integer period, reflecting that the user has identified the period manually. Then pass this value in and use it.
- Make the PolynomialDecomposer intelligently determine the period of the seasonal signal.