-
Notifications
You must be signed in to change notification settings - Fork 83
Implement SumTranform #1013
Copy link
Copy link
Closed
Description
🚀 Feature Request
Add SumTransform
as an inheritor of WindowStatisticsTransform
(https://github.com/tinkoff-ai/etna/blob/master/etna/transforms/math/statistics.py#L12) in etna.transforms.math.statistics
.
Proposal
Add class
SumTransform(WindowStatisticsTransform):
def __init__(
self,
in_column: str, # name of column to apply transformation
window: int, #
seasonality: int = 1,
min_periods: int = 1,
fillna: float = 0,
out_column: Optional[str] = None,
):
"""Init SumTransform.
Parameters
----------
in_column:
name of processed column
window:
size of window to aggregate, if window == -1 compute rolling sum all over the given series
seasonality:
seasonality of lags to compute window's aggregation with
min_periods:
min number of targets in window to compute aggregation;
if there is less than ``min_periods`` number of targets return None
fillna:
value to fill results NaNs with
out_column:
result column name. If not given use ``self.__repr__()``
"""
How to:
- implement
_aggregate
methods to compute sum withbottleneck.nansum
Test cases
Add tests for both window == -1
and window != -1
cases and different seasonalities.
Check that it works with nans https://github.com/tinkoff-ai/etna/blob/master/tests/test_transforms/test_math/test_statistics_transform.py#L294.
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done