Simplistic jupyter-notebook based GUI for pymc

Hi! After this twitter thread(ss and link attached) I’ve been thinking about this, and I’m sure a simplistic GUI would make it very accessible to people who are more familiar with maths than the coding part, or if someone just quickly wants to get a simple task done. One hypothetical way of going about it is- we create a parametric version of notebooks in pymc-examples, create a function for all the cells, that a user can manipulate with their own values, for widely used operations, voila dashboards can be easily built on jupyter-notebooks, where users can select operation and data. This is just something up for discussion, I’d love to hear what you think about it, feel free to comment anything. If, anyone is interested in it, I’d be happy to contribute in a few PRs

1 Like

Maybe you mean something like panel? The gallery on their web page mostly showcases visualisations, but you could easily define a set of widgets to parametrise a model.

Another less elaborate option might be ipywigets.

1 Like

ipywidgets are exactly what voila dashboards are based on, i did a small reference management project for uni, that was a primitive example of a dashboard to search through references and retrieve metadata for papers, basically accessing a database without an explicit website or something, directly from the jupyter notebook. so we creat multiple ipywidgets and display them in a sort of board that looks like an interactive webpage, all of those widgets represent operations on chunks of code, so if that makes any sense

1 Like

I can’t speak for the devs - just my own opinion - but if you’re motivated to try then give it a go :slight_smile:

Just to help define further, are you perhaps thinking of something like ShinyStan and to a lesser extent Bayesplot? If so, then Arviz provides a wealth of graphical model introspection and is Bokeh friendly too. I’m not aware of anyone baking this into a GUI per se, but I’m sure it could be done.

Even further, if you’re after simple model definition like brms then you might want to check out Bambi which IMO has similar goals.

Cheers

2 Likes

This is a discussion that ha been had a couple of times but has been stuck in the idea phase! So that is to say there are other data points that there potentially could be an audience for this. Its come up with PyMC Labs clients couple of times who wish to have a simple interface for their employees to adjust prebuilt models.

The closest thing I’ve seen is https://www.statapillar.com/

So far though no one has done the on the OSS side no one has done the “quick prototype thing” where they build a prototype over a weekend, from my perspective its only a matter of time

CC @twiecki

2 Likes

I wasn’t aware of those, I’ll have a look and see if I can get some ideas to take away. thanks!

2 Likes

I looked, while it seems useful for corporates, what I was hinting towards was something that would need you to define the model, but in a simplistic way, perhaps just using symbols like we write on pen and paper, or selecting from some menus etc, and statapillar seems to do some sort of - consultancy kind of an operation? where you don’t have to know math or code either. I’m thinking a simple open source interface that gets installed with pymc, can be opened in a notebook, once we build something simple, it can be expanded and customized. I’ll be happy to give it a go on my fork of pymc3, if it looks feasible we can think of comprehensive ways to go about it.

1 Like

Hmm. I very much believe in making advanced tools approachable / usable / reliable, and helping as many people as possible to use them, but it has to be a two-way street. IMO there’s only so far you can wrap a tool with ease-of-use before you start masking the underlying concepts - and then as/when models perform unexpectedly as they inevitably do, it becomes very hard to debug and untrained end-users simply lose trust. You wouldn’t expect to safely lap a racecar if your only experience is a family hatchback :slight_smile:

I think there’s definitely some merit in the UI for moderately-trained people though.

I think there’s huge room for innovation here. I think a UI for creating PyMC3 models is a big task that requires some an incredible vision. In my experience, these tools almost always fall short.

A smaller, more achievable but similarly powerful approach would be to build a UI for configuring and running an existing model. For example, a UI that allows to switch out priors or set parameters for them, run inference, analyze outputs, all with just a few clicks.