rules/feature_engine/forecasting-nonpositive-periods.md
LagFeatures and WindowFeatures shift series backward by periods steps before computing lags or rolling statistics, and raise ValueError if periods is 0 or negative.
diff
| 1 | -lags = LagFeatures(variables=["sales"], periods=[0, 1, 7]) |
| 2 | +lags = LagFeatures(variables=["sales"], periods=[1, 7]) |
What the rule reports
Calls to LagFeatures or WindowFeatures with periods set to 0, a negative integer, or a list containing 0 or a negative integer.
How to fix it
Use strictly positive integer lags (periods >= 1) so forecasting features only depend on past observations.