Closed rohanbabbar04 closed 1 month ago
sample_prior_predictive emits a message. saying "Samplig", plus a list of the sampled variables. We should disable that message. It is generated with the logging module. We should suppress it locally with a context manager, or disable it before sampling and enable it again after sampling. We need to do this to avoid messing up calls to sample_prior_predictive
outside of predictive_explorer
It is not needed for this PR, but something to think about.
We may want to try to guess the value of "engine", for instance for a pymc model we could inspect the source and detect the regex pattern for "with pm.Model() as" where the particle "pm." is something that can vary. For Bambi it should also be simple to detect it.
We may want to keep the "engine" argument and default to "auto" or something similar, just in case our automatic detection fails
sample_prior_predictive emits a message. saying "Samplig", plus a list of the sampled variables. We should disable that message. It is generated with the logging module. We should suppress it locally with a context manager, or disable it before sampling and enable it again after sampling. We need to do this to avoid messing up calls to
sample_prior_predictive
outside of predictive_explorer
Created a contextmanager to handle the logs generated during this step.
It is not needed for this PR, but something to think about.
We may want to try to guess the value of "engine", for instance for a pymc model we could inspect the source and detect the regex pattern for "with pm.Model() as" where the particle "pm." is something that can vary. For Bambi it should also be simple to detect it.
We may want to keep the "engine" argument and default to "auto" or something similar, just in case our automatic detection fails
Sounds good.... Let me create a new issue for this
I am currently keeping the sampling pymc code separated from the preliz code, like it was discussed in the jupyter notebook. Better to not disrupt the current implementation of the already existing preliz code. If required we can combine the codes later...
agreed, we can refactor and combine later. Something really easy to combine is the plotting part, right?
agreed, we can refactor and combine later. Something really easy to combine is the plotting part, right?
Yes...
Description
engine
to predictive_explorer.