Skip to content

Folds number estimation #1279

Merged
merged 11 commits into from Jun 6, 2023
Merged

Folds number estimation #1279

merged 11 commits into from Jun 6, 2023

Conversation

brsnw250
Copy link
Collaborator

@brsnw250 brsnw250 commented Jun 1, 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

closes #1235

@brsnw250 brsnw250 self-assigned this Jun 1, 2023
@github-actions
Copy link

github-actions bot commented Jun 1, 2023

@github-actions github-actions bot temporarily deployed to pull request June 1, 2023 12:24 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2023

Codecov Report

Merging #1279 (c6ffaae) into master (bcb98a6) will decrease coverage by 0.10%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #1279      +/-   ##
==========================================
- Coverage   88.01%   87.91%   -0.10%     
==========================================
  Files         186      187       +1     
  Lines       10778    10822      +44     
==========================================
+ Hits         9486     9514      +28     
- Misses       1292     1308      +16     
Impacted Files Coverage Δ
etna/commands/utils.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

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

@Mr-Geekman Mr-Geekman self-requested a review June 2, 2023 07:08
Parameters
----------
pipeline:
pipeline for which to estimate number of folds.
Copy link
Contributor

Choose a reason for hiding this comment

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

May be it should be written in a capitalized way.

from etna.transforms import MeanTransform


def run_forecast_test(pipeline, context_size, ts, expected):
Copy link
Contributor

Choose a reason for hiding this comment

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

From the name of the file it isn't clear that this test is made for estimate_max_n_folds. We should rename the file or the test.

etna/commands/utils.py Show resolved Hide resolved
raise ValueError("Parameter `ts` is required when estimating for backtest method")

if ts is not None and len(ts.index) == 0:
raise ValueError("Empty ts is passed!")
Copy link
Contributor

Choose a reason for hiding this comment

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

What is so special about empty ts?

Copy link
Collaborator Author

@brsnw250 brsnw250 Jun 2, 2023

Choose a reason for hiding this comment

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

This can be removed because we checking condition num_points >= horizon + context_size.

tests/test_commands/test_utils.py Show resolved Hide resolved
tests/test_commands/test_utils.py Show resolved Hide resolved
@Mr-Geekman
Copy link
Contributor

Don't forget to add changelog before merging the task.

@github-actions github-actions bot temporarily deployed to pull request June 2, 2023 13:33 Inactive
@brsnw250 brsnw250 requested a review from Mr-Geekman June 2, 2023 14:01
(10, 5, 5, 5, 1),
),
)
def test_estimate_n_folds(num_points, horizon, stride, context_size, expected):
Copy link
Contributor

Choose a reason for hiding this comment

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

May be it should be called test_private_estimate_n_folds

Copy link
Contributor

@Mr-Geekman Mr-Geekman left a comment

Choose a reason for hiding this comment

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

Look at comments above

@github-actions github-actions bot temporarily deployed to pull request June 6, 2023 08:45 Inactive
@brsnw250 brsnw250 requested a review from Mr-Geekman June 6, 2023 09:42
pipeline:
Pipeline for which to estimate number of folds.
method_name:
Method name for which to estimate number of folds.
Copy link
Contributor

Choose a reason for hiding this comment

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

I see here indentation of 3 spaces instead of 4.

where :math:`num\\_points` is number of points in the dataset,
:math:`horizon` is length of forecasting horizon,
:math:`stride` is number of points between folds,
:math:`context\\_size` is model context size.
Copy link
Contributor

Choose a reason for hiding this comment

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

Context size of pipeline, not model.

@brsnw250 brsnw250 requested a review from Mr-Geekman June 6, 2023 09:49
@github-actions github-actions bot temporarily deployed to pull request June 6, 2023 09:53 Inactive
@github-actions github-actions bot temporarily deployed to pull request June 6, 2023 10:00 Inactive
@brsnw250 brsnw250 merged commit 8e8c0f6 into master Jun 6, 2023
13 checks passed
@Mr-Geekman Mr-Geekman deleted the issue-1235 branch June 6, 2023 11:02
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.

Folds number estimation
3 participants