We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The R filtering API is like
pos <- filter_posteriors(my_pdb, data_name == "eight_schools")
The same exact API cannot be done in python*. I propose this instead
pos = my_pdb.filter_posteriors(lambda posterior: posterior.data.name == "eight_schools")
In other words, filter_posteriors takes a function that takes a posterior object and returns a bool.
filter_posteriors
The function doesn't have to be given inline, the following is valid too
def filter_function(posterior): return posterior.data.name == "eight_schools" pos = my_pdb.filter_posteriors(filter_function)
Return value of filter_posteriors is a list of posterior objects.
I also propose adding filter_models and filter_data that are equivalent to filter_posteriors but act instead on models or data.
filter_models
filter_data
The following query finds the posteriors where model has keyword bda3_example
bda3_example
filtered_models = my_pdb.filter_models(lambda model: "bda3_example" in model.information["keywords"]) filtered_posteriors = my_pdb.filter_posteriors(lambda posterior: posterior.model in filtered_models)
[*] This is because python doesn't support unevaluated expressions like data_name == "eight_schools"
data_name == "eight_schools"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The R filtering API is like
The same exact API cannot be done in python*. I propose this instead
In other words,
filter_posteriors
takes a function that takes a posterior object and returns a bool.The function doesn't have to be given inline, the following is valid too
Return value of
filter_posteriors
is a list of posterior objects.I also propose adding
filter_models
andfilter_data
that are equivalent tofilter_posteriors
but act instead on models or data.The following query finds the posteriors where model has keyword
bda3_example
[*] This is because python doesn't support unevaluated expressions like
data_name == "eight_schools"
The text was updated successfully, but these errors were encountered: