Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new parameters accept invalid values that silently produce behavior outside their documented contracts.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds count-based vertical barriers and influence-aware, two-sided z-score event sampling to the labeling and filtering APIs.
Changes:
- Adds
num_barssupport for vertical barriers. - Extends z-score filtering with influence-weighted event handling.
- Adds synthetic oracle-parity and regression coverage.
| File | Description |
|---|---|
mlfinpy/labeling/labeling.py |
Implements count-based barriers. |
mlfinpy/filters/filters.py |
Implements influence-aware z-score filtering. |
tests/test_parity_2308.py |
Adds parity and edge-case tests. |
tests/test_data/poseidon_parity_2308.json |
Provides synthetic golden fixtures. |
tests/test_filters.py |
Updates market-data expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| >= raw_time_series.rolling(window=mean_window).mean() | ||
| + z_score * raw_time_series.rolling(window=std_window).std() | ||
| ].index | ||
| values = raw_time_series.to_numpy() |
Comment on lines
+118
to
+120
| if num_bars is not None: | ||
| # Count observations rather than elapsed time; an absent event raises KeyError. | ||
| nearest_index = np.array([close.index.get_loc(event) + num_bars for event in t_events], dtype=int) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Un needed