You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add FourierTransform, that creates fourier features.
Motivation
It can help to deal with multiple and non-integer seasonalities.
Proposal
Add FourierTransform, that creates fourier features.
Parameters:
period: float: the period of the seasonality to capture in frequency units of time series (must be >= 2, can be float to support not regular seasonality, for example year seasonality in weekly data);
order: int: number of Fourier components to include (must be <= 2*period).
Fourier k-th component:
s_k(t) = \sin\left( 2 pi k \frac{t}{p f} \right)
c_k(t) = \cos\left( 2 pi k \frac{t}{p f} \right)
where p - period, f - freq of time series, t - time from the "zero" of the period (can be the beginning of the series).
It will be better to do it without PerSegmentWrapper.
To take care of names of the columns we want to create more precise object constructor, that can create one particular column (its repr will be the default name of the column). For example, it will take in:
period
mods: list of components, that distinguishes sin and cos.
For example mods=[0, 1, 2] creates s_1, c_1, s_2.
The constructor with order can reuse this precise constructor.
Parameter out_column is a prefix name for all the columns and single columns are separated by _{number} suffix (like in LagTransform).
Test cases
Columns with expected names are added with out_column and without out_column parameter. (It can be better to test general and specific constructors separately).
Values are expected (test integer and float periods).
Constraints are satisfied for period and mods (may be be possible to also check order here, but it can be managed inside constructor with mods).
Sanity check example with two seasonalities. We are going to catch them by using only this transform two times.
Alternatives
No response
Additional context
No response
Checklist
I discussed this issue with ETNA Team
The text was updated successfully, but these errors were encountered:
🚀 Feature Request
Add
FourierTransform
, that creates fourier features.Motivation
It can help to deal with multiple and non-integer seasonalities.
Proposal
Add
FourierTransform
, that creates fourier features.Parameters:
Fourier k-th component:
where
p
- period,f
- freq of time series,t
- time from the "zero" of the period (can be the beginning of the series).It will be better to do it without
PerSegmentWrapper
.Use Fourier and CalendarFourier for reference.
To take care of names of the columns we want to create more precise object constructor, that can create one particular column (its repr will be the default name of the column). For example, it will take in:
For example
mods=[0, 1, 2]
createss_1, c_1, s_2
.The constructor with
order
can reuse this precise constructor.Parameter
out_column
is a prefix name for all the columns and single columns are separated by _{number} suffix (like inLagTransform
).Test cases
out_column
and withoutout_column
parameter. (It can be better to test general and specific constructors separately).period
andmods
(may be be possible to also checkorder
here, but it can be managed inside constructor withmods
).Alternatives
No response
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: