-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Backtest start * Backtest fix tests * Add backtest utils * Add deprecated decorator * Add backtest to pipeline * Revert "Add deprecated decorator" This reverts commit e507ae7. * Add docstring * Upd CHANGELOG * Make backtest work with pipelines * Apply suggestions from code review Co-authored-by: Martin Gabdushev <33594071+martins0n@users.noreply.github.com> * Fix metric.class.name -> metric.repr in backtest metrics computation * Add conftests for pipelines, ensembles * Upd CHANGELOG Co-authored-by: Martin Gabdushev <33594071+martins0n@users.noreply.github.com>
- Loading branch information
1 parent
f82f5e5
commit 9c37a03
Showing
12 changed files
with
654 additions
and
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from typing import Dict | ||
from typing import List | ||
|
||
from etna.datasets import TSDataset | ||
from etna.metrics import Metric | ||
|
||
|
||
def compute_metrics(metrics: List[Metric], y_true: TSDataset, y_pred: TSDataset) -> Dict[str, float]: | ||
""" | ||
Compute metrics for given y_true, y_pred. | ||
Parameters | ||
---------- | ||
metrics: | ||
list of metrics to compute | ||
y_true: | ||
dataset of true values of time series | ||
y_pred: | ||
dataset of time series forecast | ||
Returns | ||
------- | ||
dict of metrics in format {"metric_name": metric_value} | ||
""" | ||
metrics_values = {} | ||
for metric in metrics: | ||
metrics_values[metric.__repr__()] = metric(y_true=y_true, y_pred=y_pred) | ||
return metrics_values |
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
Oops, something went wrong.