Skip to content

fix(labeling): support count barriers and influence-aware z-score events - #10

Closed
sseveran wants to merge 1 commit into
baobach:mainfrom
poseidonresearch:codex/upstream-parity-2308
Closed

sseveran wants to merge 1 commit into
baobach:mainfrom
poseidonresearch:codex/upstream-parity-2308

Conversation

@sseveran

@sseveran sseveran commented Oct 5, 2026 •

Copy link
Copy Markdown

Un needed

Copilot AI balanced review requested due to automatic review settings October 5, 2026 22:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new parameters accept invalid values that silently produce behavior outside their documented contracts.

Review effort: Balanced
Findings: 2 Medium severity

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_bars support 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)
@sseveran sseveran closed this Oct 5, 2026
@sseveran
sseveran deleted the codex/upstream-parity-2308 branch October 5, 2026 23:16
@sseveran
sseveran restored the codex/upstream-parity-2308 branch October 5, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants