Repository navigation
[FEAT] Add conformal_error prediction intervals method - #1175
Conversation
There was a problem hiding this comment.
Thanks for picking this up. However, there's a blocker outside the diff plus two issues in the new code (inline comments below).
Blocker: the method can't actually be enabled. ConformalIntervals.__init__ in python/statsforecast/utils.py still has allowed_methods = ["conformal_distribution"], so ConformalIntervals(method="conformal_error") — the only public entry point, and what the new test constructs — raises ValueError. I ran test_conformal_error_intervals locally and it fails at exactly that line. Please add "conformal_error" to allowed_methods and update the class docstring there as well.
Given that gate was missed, it would also be worth adding one end-to-end test through a real model (e.g. AutoARIMA(prediction_intervals=ConformalIntervals(method="conformal_error")) via StatsForecast.forecast) so the public path is exercised.
…lumn ordering, and test strength - utils.py: add 'conformal_error' to ConformalIntervals allowed_methods - models.py: fix quantile cut from 1-alpha/200 to correct lv/100 - models.py: fix column output order to match conformal_distribution convention - test_models.py: add exact-value assertions to catch quantile formula errors
…lumn ordering, and test strength - utils.py: add 'conformal_error' to ConformalIntervals allowed_methods - models.py: fix quantile cut from 1-alpha/200 to correct lv/100 - models.py: fix column output order to match conformal_distribution convention - test_models.py: add exact-value assertions to catch quantile formula errors - models.py: remove redundant .keys() calls in _get_conformal_method - models.py: clarify _add_conformal_error_intervals docstring
- Cache quantile computations instead of recomputing 4 times - Note that symmetry assertions are implied by exact-value checks - Reduce n_windows from 10 to 2 (minimum; ZeroModel is deterministic) - Add sync comment between allowed_methods and _get_conformal_method
|
Thanks for the thorough review — all four points addressed:
I haven't added an end-to-end test through |
|
Hello Dresden Goehner (@DresdenGman) have you pushed the changes? I cannot see anything from this side. |
|
Sorry about that — the fix commits were on a different branch. Just force-pushed them to the PR branch — you should see 3 new commits from 2026-07-10 now. |
Saul (nasaul)
left a comment
There was a problem hiding this comment.
Thanks for your contribution. Happy forecasting
Adds the
conformal_errorprediction intervals method, which uses quantiles of the conformity scores as the error margin for prediction intervals. This is a companion to the existingconformal_distributionmethod.Changes:
_add_conformal_error_intervals()function to models.py"conformal_error"in_get_conformal_method()test_conformal_error_intervals