Skip to content

Add get_residuals #597

Merged
merged 7 commits into from
Mar 15, 2022
Merged

Add get_residuals #597

merged 7 commits into from
Mar 15, 2022

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented Mar 11, 2022

IMPORTANT: Please do not create a Pull Request without creating an issue first.

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?

Type of Change

  • Examples / docs / tutorials / contributors update
  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Proposed Changes

Look #589.

Related Issue

#589.

Closing issues

Closes #589.

@Mr-Geekman Mr-Geekman added the enhancement New feature or request label Mar 11, 2022
@Mr-Geekman Mr-Geekman self-assigned this Mar 11, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2022

Codecov Report

Merging #597 (faff52e) into master (e16d25d) will increase coverage by 0.06%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master     #597      +/-   ##
==========================================
+ Coverage   85.13%   85.20%   +0.06%     
==========================================
  Files         117      117              
  Lines        5806     5818      +12     
==========================================
+ Hits         4943     4957      +14     
+ Misses        863      861       -2     
Impacted Files Coverage Δ
etna/analysis/plotters.py 19.23% <82.35%> (+2.87%) ⬆️
etna/analysis/__init__.py 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@martins0n martins0n self-requested a review March 14, 2022 07:48
"""
from etna.datasets import TSDataset

# make flatten dataframes for vectorized operations
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, why we need flatten?
Whats the difference of tsdataset format in case of subtractions?
In both case we subtract one array from another.
And we wouldn't need extra checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think, that checks on the length is still necessary. Ok, I'll try wide-version and check out if validating length or segments is important or not.

new_ts = TSDataset(df=new_df, freq=ts.freq)
new_ts.known_future = ts.known_future
new_ts._regressors = ts.regressors
new_ts.transforms = ts.transforms
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems transforms don't have any sense, do them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if we have transforms in the original TSDataset it is strange to remove them.

def test_get_residuals(ts_fixture, request):
"""Test that get_residuals finds residuals correctly."""
ts = request.getfixturevalue(ts_fixture)
pipeline = Pipeline(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't need the whole pipeline to test this small function.
It's overkill, no?

@martins0n martins0n merged commit c309803 into master Mar 15, 2022
@martins0n martins0n deleted the issue-589 branch March 15, 2022 15:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create method get_residuals
3 participants