-
Notifications
You must be signed in to change notification settings - Fork 3
Updated bmc.predict() to also output model weights draws #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Update bmc.py to output weights
Pranav patch to output model weights
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
I have made changes to the tests to incorporate the weight outputs in them, so they don't fail. Updated docstrings too. |
No description provided.