tinkoff-ai / etna

ETNA – Time-Series Library

Home Page:https://etna.tinkoff.ru

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shift of exogenous data

brsnw250 opened this issue Β· comments

πŸš€ Feature Request

Add class ExogShiftTransform for automatic shift of exogenous data based on lag transform.

Proposal

class ExogShiftTransform(IrreversibleTransform, FutureMixin):
    def __init__(self, lags: Union[int, Literal["auto"]], horizon: Optional[int] = None):
        pass

   def _fit(self, df: pd.DataFrame) -> "ExogShiftTransform":
       pass
   
   def _transform(self, df: pd.DataFrame) -> pd.DataFrame:
       pass
  • lags: int -- use passed value to shift all exog columns
  • lags="auto" -- compute the size of the shift automatically. In this case, estimate for each series the minimal number of steps required to cover all horizon. It may be possible that each exog series will have its own shift size. Computation may be performed using the last available date of the exog variable and the prediction horizon.

When lags="auto" parameter horizon is mandatory.

Name shifted columns in format {exog_name}_shift_{exog_shift_size}.

Test cases

  • Test all necessary parameters set when initialising the transform.
  • Test that names for transformed data are correct.
  • Test all exog data correctly shifted for both modes.
  • Test that transform works within Pipeline for both modes.
  • Add transform to inference tests.

Additional context

No response

It seems like the task #1072 is relevant here.

It seems like the task #946 is relevant here.