Last active
June 3, 2022 08:02
-
-
Save alex-hse-repository/b7599532509f64f9e2bd43d8847eb1c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from etna.models import CatBoostModelPerSegment | |
from etna.transforms import DateFlagsTransform, FourierTransform | |
HORIZON = 62 | |
pipeline = Pipeline( | |
model=CatBoostModelPerSegment(), | |
transforms=[ | |
DensityOutliersTransform(in_column="target", window_size=30, n_neighbors=9, distance_coef=1), | |
TimeSeriesImputerTransform(in_column="target", strategy="running_mean", window=3), | |
FourierTransform(period=365.25, order=4), | |
DateFlagsTransform(day_number_in_week=True, day_number_in_month=False, is_weekend=False), | |
], | |
horizon=HORIZON, | |
) | |
metrics, forecast, _ = pipeline.backtest(ts, metrics=[SMAPE()], n_folds=3) | |
plot_backtest(forecast, ts, history_len="all") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment