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
ETNA should have transform that allows to mark days before and after event (holiday, promo or else)
Motivation
Now we ought to manually create such features. It is not convinient.
Proposal
Add an EventTransform with init parameters:
in_column: str binary column with event indicator,
out_column: str base for creating out columns names,
n_pre: int default 1, number of days before the event to react ,
n_post: int default 1, number of days after the event to react,
mode: str, default binary, possible values:
binary: the created columns are binary ,
distance: the created columns show distance to the closest true value.
This transform creates two columns: {out_column}_pre, {out_column}_post. First column is dealing with reaction to the event before it started, the second is dealing with reaction after event has ended.
Let's explain modes of operation:
In binary mode pre column shows value to 1 if the distance to the closest event in the future is in [1, n_pre], otherwise shows 0.
In distance mode pre column shows 1/distance to the closest event in the future if the distance is in [1, n_pre], otherwise shows 0.
In binary mode post column changes its value to 1 if the distance to the closest event in the past is in [1, n_post], otherwise shows 0.
In distance mode post column shows 1/distance to the closest event in the past if the distance is in [1, n_post], otherwise shows 0.
In params to tune we should tune:
n_pre: from 1 to the n_pre set by user,
n_post: from 1 to the n_post set by user,
mode: both possible values.
Implement get_regressors_info:
If column is regressor, out_column will be regressor;
Issue by iKintosh
Tuesday Jun 21, 2022 at 07:33 GMT
Originally opened as tinkoff-ai#765
馃殌 Feature Request
ETNA should have transform that allows to mark days before and after event (holiday, promo or else)
Motivation
Now we ought to manually create such features. It is not convinient.
Proposal
Add an
EventTransform
with init parameters:in_column: str
binary column with event indicator,out_column: str
base for creating out columns names,n_pre: int
default 1, number of days before the event to react ,n_post: int
default 1, number of days after the event to react,mode: str
, defaultbinary
, possible values:binary
: the created columns are binary ,distance
: the created columns show distance to the closest true value.This transform creates two columns:
{out_column}_pre
,{out_column}_post
. First column is dealing with reaction to the event before it started, the second is dealing with reaction after event has ended.Let's explain modes of operation:
binary
modepre
column shows value to 1 if the distance to the closest event in the future is in[1, n_pre]
, otherwise shows 0.distance
modepre
column shows 1/distance to the closest event in the future if the distance is in[1, n_pre]
, otherwise shows 0.binary
modepost
column changes its value to 1 if the distance to the closest event in the past is in[1, n_post]
, otherwise shows 0.distance
modepost
column shows 1/distance to the closest event in the past if the distance is in[1, n_post]
, otherwise shows 0.In params to tune we should tune:
n_pre
: from 1 to then_pre
set by user,n_post
: from 1 to then_post
set by user,mode
: both possible values.Implement
get_regressors_info
:out_column
will be regressor;out_column
isn't regressor.Example:
Test cases
n_pre
orn_post
between themtests/test_transforms/test_inference
Alternatives
No response
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: