Skip to content

Deviation metric #1061

Merged
merged 3 commits into from
Jan 9, 2023
Merged

Deviation metric #1061

merged 3 commits into from
Jan 9, 2023

Conversation

Ama16
Copy link
Contributor

@Ama16 Ama16 commented Jan 9, 2023

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Proposed Changes

Closing issues

@github-actions
Copy link

github-actions bot commented Jan 9, 2023

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2023

Codecov Report

Merging #1061 (c8ef119) into master (f46b363) will increase coverage by 0.11%.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##           master    #1061      +/-   ##
==========================================
+ Coverage   86.15%   86.27%   +0.11%     
==========================================
  Files         163      163              
  Lines        8641     8656      +15     
==========================================
+ Hits         7445     7468      +23     
+ Misses       1196     1188       -8     
Impacted Files Coverage Δ
etna/metrics/functional_metrics.py 86.20% <83.33%> (-0.75%) ⬇️
etna/metrics/__init__.py 100.00% <100.00%> (ø)
etna/metrics/metrics.py 100.00% <100.00%> (ø)
etna/auto/runner/utils.py 50.00% <0.00%> (-50.00%) ⬇️
etna/libs/tsfresh/relevance.py 77.14% <0.00%> (+0.95%) ⬆️
etna/libs/tsfresh/significance_tests.py 46.37% <0.00%> (+14.49%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions github-actions bot temporarily deployed to pull request January 9, 2023 08:58 Inactive
@@ -116,4 +116,34 @@ def sign(y_true: ArrayLike, y_pred: ArrayLike) -> float:
return np.mean(np.sign(y_true_array - y_pred_array))


def deviation(y_true: ArrayLike, y_pred: ArrayLike) -> float:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be max_deviation metric, shouldn't it?

@@ -272,4 +273,33 @@ def greater_is_better(self) -> None:
return None


__all__ = ["MAE", "MSE", "RMSE", "R2", "MSLE", "MAPE", "SMAPE", "MedAE", "Sign"]
class MaxDeviation(Metric):
"""Max Deviation metric with multi-segment computation support.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add to docs explanation of metric's computation?

"""Max Deviation metric with multi-segment computation support.

.. math::
MaxDeviation(y\_true, y\_pred) = \\max | y_j |, where \\, y_j = \\sum_{i=1}^{n}{y\_pred_i - y\_true_i}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about it, but shouldn't it be

Suggested change
MaxDeviation(y\_true, y\_pred) = \\max | y_j |, where \\, y_j = \\sum_{i=1}^{n}{y\_pred_i - y\_true_i}
MaxDeviation(y\_true, y\_pred) = \\max_{j} | y_j |, where \\, y_j = \\sum_{i=1}^{j}{y\_pred_i - y\_true_i}

@github-actions github-actions bot temporarily deployed to pull request January 9, 2023 11:27 Inactive
@Ama16 Ama16 merged commit 56990dd into master Jan 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants