-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/tinkoff-ai/etna-ts into i…
…ssue-508
- Loading branch information
Showing
4 changed files
with
123 additions
and
30 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import pytest | ||
|
||
from etna.analysis import plot_residuals | ||
from etna.metrics import MAE | ||
from etna.models import LinearPerSegmentModel | ||
from etna.pipeline import Pipeline | ||
from etna.transforms import LagTransform | ||
|
||
|
||
def test_plot_residuals_fails_unkown_feature(example_tsdf): | ||
"""Test that plot_residuals fails if meet unknown feature.""" | ||
pipeline = Pipeline( | ||
model=LinearPerSegmentModel(), transforms=[LagTransform(in_column="target", lags=[5, 6, 7])], horizon=5 | ||
) | ||
metrics, forecast_df, info = pipeline.backtest(ts=example_tsdf, metrics=[MAE()], n_folds=3) | ||
with pytest.raises(ValueError, match="Given feature isn't present in the dataset"): | ||
plot_residuals(forecast_df=forecast_df, ts=example_tsdf, feature="unkown_feature") |