Skip to content

Add stride parameter into backtest #1165

Merged
merged 8 commits into from
Mar 17, 2023
Merged

Add stride parameter into backtest #1165

merged 8 commits into from
Mar 17, 2023

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented Mar 15, 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

Look #1160.

Closing issues

Closes #1160.

@Mr-Geekman Mr-Geekman self-assigned this Mar 15, 2023
@github-actions
Copy link

github-actions bot commented Mar 15, 2023

@github-actions github-actions bot temporarily deployed to pull request March 15, 2023 12:39 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

❗ No coverage uploaded for pull request base (inference-v2.1@02bf892). Click here to learn what that means.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@                Coverage Diff                @@
##             inference-v2.1    #1165   +/-   ##
=================================================
  Coverage                  ?   87.10%           
=================================================
  Files                     ?      164           
  Lines                     ?     9070           
  Branches                  ?        0           
=================================================
  Hits                      ?     7900           
  Misses                    ?     1170           
  Partials                  ?        0           

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

@@ -763,6 +780,7 @@ def _run_all_folds(
}
return results

# TODO: inconsistency between mode and stride
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should discuss this. We ignore mode on n_folds: List[FoldMask], but fail on stride (not ignore).

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain this in more details?

It's expecting behaviour I guess. List[FoldMask] is proposed to take full control on folds settings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If n_folds: List[FoldMask] then we ignore mode parameter because n_folds takes a full control. But if we set custom stride, it doesn't ignore it and fails.

But we also have a difference for handling of this parameters:

  • mode has some value default value, and we can't fail on it.
  • stride has None default value that indicates default behavior and setting it manually to some int can be strange if n_folds: List[FoldMask].

May be we should decide what is better: fail on stride: int if n_folds: List[FoldMask] or just ignore it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just ignore I guess

@github-actions github-actions bot temporarily deployed to pull request March 15, 2023 13:22 Inactive
@Mr-Geekman Mr-Geekman requested a review from martins0n March 16, 2023 07:41
@@ -763,6 +780,7 @@ def _run_all_folds(
}
return results

# TODO: inconsistency between mode and stride
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain this in more details?

It's expecting behaviour I guess. List[FoldMask] is proposed to take full control on folds settings

("constant", 3, 1, None, [0, 7, 14], [-22, -15, -8], [-21, -14, -7], [-15, -8, -1]),
("constant", 3, 2, None, [0, 0, 14], [-22, -22, -8], [-21, -14, -7], [-15, -8, -1]),
("constant", 3, 3, None, [0, 0, 0], [-22, -22, -22], [-21, -14, -7], [-15, -8, -1]),
("constant", 3, 4, None, [0, 0, 0], [-22, -22, -22], [-21, -14, -7], [-15, -8, -1]),
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe these parameters could be more obvious in case we use horizon as variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll extract it.

tests/test_pipeline/test_pipeline.py Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pull request March 17, 2023 07:22 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 17, 2023 12:02 Inactive
@Mr-Geekman Mr-Geekman merged commit 91a9105 into inference-v2.1 Mar 17, 2023
@Mr-Geekman Mr-Geekman deleted the issue-1160 branch March 17, 2023 12:32
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