Skip to content

Conversation

@BlurSure
Copy link

No description provided.

Copy link
Contributor

Copilot AI left a 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 new output_weights parameter
  • 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

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.

@BlurSure
Copy link
Author

I have made changes to the tests to incorporate the weight outputs in them, so they don't fail. Updated docstrings too.

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.

2 participants