ExpandingCutoffFilter
idea
#6327
Replies: 2 comments
-
Interesting! Sounds like a great idea! I think it might be time to test our new splitter extension template and Let us know if you need help, but you've done this before (well, for other object types, but it should work similarly) |
Beta Was this translation helpful? Give feedback.
-
@fkiraly forecaster = TransformedTargetForecaster(
[
("deseasonalizer", OptionalPassthrough(Deseasonalizer(sp=4))),
("boxcox", OptionalPassthrough(BoxCoxTransformer())),
("detrender", OptionalPassthrough(Detrender())),
("forecaster",
EnsembleForecaster(
[
("naive", NaiveForecaster()),
("ets", StatsForecastAutoETS()),
]
),
),
]
)
param_grid = {
"deseasonalizer__passthrough": [True, False],
"boxcox__passthrough": [True, False],
"detrender__passthrough": [True, False],
"forecaster__naive__strategy": ["last", "mean", "drift"],
"forecaster__ets__damped": [True, False],
}
cutoffs = [pd.Timestamp("2021-Q1"), pd.Timestamp('2021-Q2')]
cv = ExpandingCutoffSplitter(fh=[1, 2, 3], cutoffs=cutoffs)
gscv = ForecastByLevel(
ForecastingGridSearchCV(
forecaster=forecaster,
param_grid=param_grid,
cv=cv,
scoring=MeanAbsolutePercentageError()
)
)
gscv.fit(df)
### Want to be able to do the following
# 1) Get a list of the best possible params, currently available from ForecastingGridSearchCV
# but not when wrapped in ForecastByLevel.
list_best_possible_params = gscv.best_params_
# 2) Take list of params and plug it back into real-time forecasts.
model = ForecastByLevel(
forecaster,
forecaster_set_method={
"_set_params": list_best_possible_params
}
)
model.fit(y_train, fh)
model.predict()``` |
Beta Was this translation helpful? Give feedback.
-
Is there interest in creating a hybrid of
ExpandingWindowSplitter
andCutoffSplitter
? This concept stems from the need to backtest hierarchical data encompassing various products, each with a unique start date. The currentCutoffSplitter
targets specific dates but relies on awindow_length
parameter, making it resemble aSlidingWindowSplitter
with a set cutoff rather than an initial window. Meanwhile, theCutoffFhSplitter
shares a similar idea but does not support hierarchical data use.The goal would be to:
evaluate
andForecastingGridSearchCV
Beta Was this translation helpful? Give feedback.
All reactions