PEtab-dev / petab_select

Repository for development of the model selection extension
https://petab-select.readthedocs.io
BSD 3-Clause "New" or "Revised" License
9 stars 0 forks source link

Visualization code #9

Open dilpath opened 2 years ago

dilpath commented 2 years ago

Other suggestions welcome

dweindl commented 8 months ago

Other suggestions welcome

For candidate spaces in the form of https://github.com/PEtab-dev/petab_select/blob/8d97c58e1f4a671fecb19881827db237f12f51e0/test_cases/0009/model_space.tsv: UpSet plots

dilpath commented 8 months ago

Other suggestions welcome

For candidate spaces in the form of https://github.com/PEtab-dev/petab_select/blob/8d97c58e1f4a671fecb19881827db237f12f51e0/test_cases/0009/model_space.tsv: UpSet plots

Agreed! I tried UpSetPlot a while ago and found that it includes some misleading elements by default, like the bottom-left subplot "Set Size" [1] here, which should be weighted by model likelihood (or e.g. Akaike weights) to be interpretable in terms of model selection. It was difficult to customize via UpSetPlot, so I ended up manipulating the matplotlib objects directly, which got messy. I can make a suggestion though.

[1] https://upload.wikimedia.org/wikipedia/commons/4/44/Upset_Plot.png

dweindl commented 8 months ago

it includes some misleading elements by default

right. wasn't too hard to get rid of it though. but yeah, via matplotlib...

dilpath commented 8 months ago

In the end I wanted something like this, which I now recall doing mostly manually in Inkscape, because many formatting elements were difficult via matplotlib, and non-binary elements (e.g. MA/MM/P) seemed impossible because the grid of dots in UpSetPlot only supports binary values. Would an upset plot for binary values only, be fine for your use cases? I could also consider writing an upset plot from scratch.

upsetplot

dweindl commented 8 months ago

and non-binary elements (e.g. MA/MM/P) seemed impossible

right

Would an upset plot for binary values only, be fine for your use cases?

Absolutely, that's what i meant to say by For candidate spaces in the form of https://github.com/PEtab-dev/petab_select/blob/8d97c58e1f4a671fecb19881827db237f12f51e0/test_cases/0009/model_space.tsv: [UpSet plots](https://en.wikipedia.org/wiki/UpSet_Plot)

I could also consider writing an upset plot from scratch.

I'd rather avoid that. For the binary case, i pretty much got what I wanted via:

axs = upset_plot.plot()
axs["intersections"].set_ylabel("something like dAIC")
plt.gcf().delaxes(axs["totals"])

image