Can we add model names when we do model comparison?

At the moment, when we run WAIC or LOO comparison of multiple models we get a nice data frame back, and can get a nice plot (like below).
46
But is there a way to provide more readable strings rather than just the model numbers? I guess this could be an additional argument in the compare() function in stats.py. Either that or be able to give the Model class a descriptive name attribute?

I’ve looked at the code on GitHub and there’s nothing I can see that lets you do this currently, unless I’m mistaken. I could swear that I saw an issue on GitHub a while ago saying how to do this exact thing, but I can’t find it any more.

Yes there are two related PR that kind of been forgotten:
https://github.com/pymc-devs/pymc3/pull/2691
https://github.com/pymc-devs/pymc3/pull/2764

Currently, the workaround is:

MODEL_NAME_MAP = {
    0: "Model1",
    1: "Model2"
}

comp_df = (pm.compare([trace1, trace2], 
                      [model1, model2])
             .rename(index=MODEL_NAME_MAP))
1 Like