feat: add predict_uncertainty() for ensemble-based regression intervals#831
Open
Debi-Prasad-Panda wants to merge 1 commit into
Open
feat: add predict_uncertainty() for ensemble-based regression intervals#831Debi-Prasad-Panda wants to merge 1 commit into
Debi-Prasad-Panda wants to merge 1 commit into
Conversation
Author
|
Hi @pplonski, apologies for the delay on this — I had a family loss. I've now opened a PR implementing It follows the exact spec you outlined — weighted mean, variance, std from ensemble sub-model predictions, with z-score based intervals from the I've also added an automatic fallback so it works even when the best model selected by AutoML is a single algorithm (it finds and uses the trained Ensemble internally). 5 unit tests are included covering all edge cases. Looking forward to your feedback! |
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.
Summary
Adds
automl.predict_uncertainty(X, alpha=0.05)for regression tasks, as discussed in the issue thread.This method computes ensemble-based uncertainty intervals using predictions from all sub-models selected in the Ensemble. For each sample:
prediction= weighted mean of sub-model predictionsprediction_variance= weighted variance of sub-model predictionsprediction_std= sqrt(prediction_variance)lower= prediction - z * prediction_stdupper= prediction + z * prediction_stdwhere
z = norm.ppf(1 - alpha/2)(e.g., z ≈ 1.96 for alpha=0.05).Important: This is documented as an ensemble disagreement interval, not a statistically calibrated confidence interval.
Changes
supervised/automl.py— Added publicpredict_uncertainty()method with full docstring.supervised/base_automl.py— Added internal_predict_uncertainty()with:tests/tests_automl/test_predict_uncertainty.py— 5 unit tests covering:Output Format