Updated bmc.predict() to also output model weights draws#23
Open
BlurSure wants to merge 10 commits intoascsn:mainfrom
Open
Updated bmc.predict() to also output model weights draws#23BlurSure wants to merge 10 commits intoascsn:mainfrom
BlurSure wants to merge 10 commits intoascsn:mainfrom
Conversation
Update bmc.py to output weights
Pranav patch to output model weights
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the bmc.predict() method to return model weight draws in addition to the existing predictions and credible intervals. This allows users to inspect the posterior distribution of model weights used in the Bayesian Model Combination.
Key Changes:
- Modified
rndm_m_random_calculator()to optionally return model weights via a newoutput_weightsparameter - Updated
bmc.predict()to request and return the model weights draws - Changed the return signature of
predict()from 4 values to 5 values
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pybmc/sampling_utils.py | Added output_weights parameter to rndm_m_random_calculator() with conditional return logic for model weights |
| pybmc/bmc.py | Updated predict() to call rndm_m_random_calculator() with output_weights=True and return the weights as a fifth output value |
Comments suppressed due to low confidence (2)
pybmc/sampling_utils.py:40
- rndm_m_random_calculator returns tuple of size 2 and tuple of size 3.
def rndm_m_random_calculator(filtered_model_predictions, samples, Vt_hat, output_weights=True):
pybmc/bmc.py:185
- Left hand side of assignment contains 2 variables, but right hand side is a tuple of length 3.
rndm_m, (lower, median, upper) = rndm_m_random_calculator(preds, self.samples, self.Vt_hat)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Edited rndm_m_random_calculator() docstring to add model weight output
Author
|
I have made changes to the tests to incorporate the weight outputs in them, so they don't fail. Updated docstrings too. |
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.
No description provided.