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.analysis import plot_imputation | |
from etna.transforms import TimeSeriesImputerTransform | |
ts = get_ts(["All_American_Ensign"]) | |
imputer = TimeSeriesImputerTransform(in_column="target", strategy="zero") | |
plot_imputation(ts, imputer, start="2016-04-01", end="2017-05-01") |
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
imputer = TimeSeriesImputerTransform(in_column="target", strategy="forward_fill") | |
plot_imputation(ts, imputer, start="2016-04-01", end="2017-05-01") |
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
imputer = TimeSeriesImputerTransform(in_column="target", strategy="running_mean", window=3) | |
plot_imputation(ts, imputer, start="2016-04-01", end="2017-05-01") |
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.analysis import plot_anomalies, get_anomalies_density | |
ts = get_ts(["East_Midlands"]) | |
anomalies = get_anomalies_density(ts, window_size=30, distance_coef=1, n_neighbors=9) | |
plot_anomalies(ts, anomalies) |
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.pipeline import Pipeline | |
from etna.models import ProphetModel | |
from etna.transforms import DensityOutliersTransform | |
from etna.metrics import SMAPE | |
HORIZON = 62 | |
pipeline = Pipeline(model=ProphetModel(), transforms=[], horizon=HORIZON) | |
pipeline_outliers = Pipeline( | |
model=ProphetModel(), | |
transforms=[ |
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
ts = get_ts(["Black_Sails"]) | |
ts.fit_transform([TimeSeriesImputerTransform(in_column="target", strategy="running_mean", window=3)]) | |
ts.plot() |
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.analysis import plot_holidays | |
holidays_df = pd.DataFrame({ | |
'holiday': 'season', | |
'ds': pd.to_datetime(["2016-01-23", "2017-01-29"]), | |
'lower_window': -21, | |
'upper_window': 90+14, | |
}) | |
plot_holidays(ts, holidays=holidays_df) |
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.analysis import plot_backtest | |
HORIZON = 365 | |
pipeline = Pipeline(model=ProphetModel(), transforms=[], horizon=HORIZON) | |
metrics, forecasts, _ = pipeline.backtest(ts, metrics=[SMAPE()], n_folds=1) | |
plot_backtest(forecast, ts) |
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
pipeline = Pipeline( | |
model=ProphetModel(yearly_seasonality=True), | |
transforms=[], | |
horizon=HORIZON | |
) | |
metrics, forecast, _ = pipeline.backtest(ts, metrics=[SMAPE()], n_folds=1) | |
plot_backtest(forecast, ts) |
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
pipeline = Pipeline( | |
model=ProphetModel(yearly_seasonality=True, holidays=holidays_df), | |
transforms=[], | |
horizon=HORIZON | |
) | |
metrics, forecast, _ = pipeline.backtest(ts, metrics=[SMAPE()], n_folds=1) | |
plot_backtest(forecast, ts) |
OlderNewer