arviz icon indicating copy to clipboard operation
arviz copied to clipboard

Misspecified var_names

Open ColCarroll opened this issue 6 years ago • 7 comments

In certain cases, if an element of var_names is not in the dataset, should we should throw an exception? Right not, it will plot any var_names it can find, and ignore the others. This behavior has actually been kind of nice when plotting a centered eight trace vs a non-centered eight trace, but confusing if you typo one of the var_names.

ColCarroll avatar Oct 06 '18 02:10 ColCarroll

Could it throw warning? Sometimes there are "missing" parameters.

Also can do some word2vec similarity scoring what was probably meant? This could be helpful for complex names?

ahartikainen avatar Oct 06 '18 03:10 ahartikainen

Have been convinced that this is ok.

ColCarroll avatar Oct 13 '18 14:10 ColCarroll

I have same sentiment as @ahartikainen Should we at least print something to the console? Right now behavior is confusing if you don't remember the exact var_name.

canyon289 avatar Oct 13 '18 14:10 canyon289

right now the behavior is equivalent to data.posterior[var_names] (and specifically, data.posterior[var_names].sel(**coords), though, which I like: i.e., matching xarray's behavior.

ColCarroll avatar Oct 13 '18 14:10 ColCarroll

Fair point, matching xarrays behavior is good idea! We can focus this discussion on how verbose we want to be to user.

canyon289 avatar Oct 13 '18 14:10 canyon289

Is it still relevant? I'd like to add this check and warnings if it's still needed

michaelraczycki avatar Feb 14 '23 09:02 michaelraczycki

Try someting like:

idata = az.load_arviz_data("rugby")
az.plot_posterior(idata, var_names=("atts", "unexisting_var"))

and see what happens

OriolAbril avatar Feb 16 '23 06:02 OriolAbril