Open OriolAbril opened 4 years ago
Regarding specific inference data method : InferenceData html repr
I have been working on this for some time. The possible implementation is https://dfm.io/nbview/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpercygautam%2Farviz-examples%2Fmaster%2FHTML%2520repr.ipynb . I used xarray's implementation as reference.
Looks great.
Do you think we should Add any extra information there? Like number of variables in each group? (not sure if this is a good idea or not)
This got me thinking, should inference data objects have a name attribute?
Looks great.
Do you think we should Add any extra information there? Like number of variables in each group? (not sure if this is a good idea or not)
Maybe, we could add dimensions for each group (when not checked). But personally, I like the minimalistic repr better.
more ideas:
idata.fun
inside it take the same groups as input (i.e. if groups=None, check context, if ouside context use all groups, otherwise use groups in context)? should not be too hard to implement, I think modifying _group_names
should be enoughastype
, not all variables in a groups need to have the same dtype.Hello!
I was wondering if you have thought about a possibility to add prior out-of-sample predictions to InferenceData
?
Maybe I am missing something, but this is currently only supported for the posterior, isn't it?
Just like predictions
a prior_predictions
group could base on the predictions_constant_data
but instead of the posterior
use the prior
group for prediction. I like to do this for model debugging in cases where prior_predictive
can be misleading because the observed variable has a lot of missing values.
InferenceData
objects are central to ArviZ, and even though a common subset of tasks using InferenceData can be done directly with ArviZ plotting and stats functions, any task that deviates from this becomes more and more convoluted and long.The aim of this issue is to start a discussion about new capabilities to add to
InferenceData
and generate a proposal (which will be added to xarray_examples for discussion with xarray team).I also think there are several groups of functions, if it may help start brainstroming or generating different proposals per group. Ideas on all levels are welcome!
Straightforward extensions to
xr.Dataset
methods.sel
is a good example of this. I think several methods could fit in this category and very roughly follow a similar pattern:In addition to
groups
we should think about other ArviZ specific args, common in most functions and not passed to xarray. Maybeinplace
and/orcopy
?Also,
groups
could accept groups and some metagroups so that one keyword represents several proper groups. We could go as far as adding the metagroups dict in rcParams. One metagroup example could be"posteriors" -> ("posterior", "sample_stats", "log_likelihood", "posterior_predictive")
Some ideas of functions that could fit in this category are:
.isel
stack
andunstack
rename
,rename_dims
andrename_vars
.load
and other dask related methods likechunk
would be interesting after ArviZ starts becoming Dask friendly.Many dataset methods make sense to extend, so I think we should focus on the ones that solve more issues on our side. For example, if we make an extension to apply_ufunc compatible with inference data or extend the map method, the mean, median, max... are not really necessary, only convenient, whereas other methods may have no alternative.
Commenting the ones you expect to use the most seems like a good start to choose where to begin with.
Specific inference data methods
This category requires a much more detailed and custom implementation. Some examples that would fall here are:
xr.where
to select from one group with a condition on another, ideally similar to pandasquery
functionprior_predictive
,posterior_predictive
,predictions
andobserved_data
(could also be an extension tomap
butapply_ufunc
should be more versatile)