Skip to content

Validate ConformalIntervals horizon - #1222

Open
DresdenGman wants to merge 1 commit into
Nixtla:mainfrom
DresdenGman:fix/conformal-interval-h-validation
Open

Validate ConformalIntervals horizon#1222
DresdenGman wants to merge 1 commit into
Nixtla:mainfrom
DresdenGman:fix/conformal-interval-h-validation

Conversation

@DresdenGman

Copy link
Copy Markdown
Contributor

Summary

  • reject non-positive ConformalIntervals horizons at construction time
  • add regression coverage for zero and negative horizons

Why

A non-positive horizon currently reaches _conformity_scores, where h=0 raises a bare ZeroDivisionError. Failing at configuration time makes the invalid input clear and avoids an unrelated-looking downstream error.

Tests

  • uv run pytest tests/test_models.py --no-cov -q — 206 passed
  • uv run ruff check python/statsforecast/utils.py tests/test_models.py

Fixes #1221

@codspeed-hq

codspeed-hq Bot commented Aug 28, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 38 untouched benchmarks


Comparing DresdenGman:fix/conformal-interval-h-validation (95d894b) with main (8b28576)

Open in CodSpeed

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.

[Core] ConformalIntervals accepts h=0 and later raises ZeroDivisionError in _conformity_scores

1 participant