Shift of exogenous data
brsnw250 opened this issue Β· comments
Maxim Zherelo commented
π 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 columnslags="auto"
-- compute the size of the shift automatically. In this case, estimate for each series the minimal number of steps required to cover allhorizon
. 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
Mr-Geekman commented
It seems like the task #1072 is relevant here.
Mr-Geekman commented
It seems like the task #946 is relevant here.