Compare() got an unexpected keyword argument 'var_name'

Hi,

I’m using Arviz to check the LOO and WAIC of two models. However, when I code something like this:
az.compare(dataset_dict = {“hierarchical”: trace_dag, “pooled”: trace_ppc1}, var_name= [‘pred_col’]),
the error message mentioned in the title will appear. How should I deal with it?

Second, as I checked the source code of arviz.loo and arviz.waic, I found that arviz.loo calculates the elpd_loo, but arviz.waic calculates true WAIC, which is elpd_waic minus variance. Am I right?

Thank you!

2 Likes

For var_name, give it a str not list.

https://arviz-devs.github.io/arviz/api/generated/arviz.compare.html

Edit. Could you check what arviz version you have? It could be that the var_name was added recently (not in pypi yet) → install github version

pip install git+https://github.com/arviz-devs/arviz

1 Like

Hi,

Thank you for your reply!

Still the same error message even if I gave it a str.

My version is 0.11.2, and I will try github version!

It works now. Thank you!