Doing multiple ML experiments in prython 1.70

francisco juretig
3 min readJun 12, 2021
Several python panels in prython 1.70 (Windows 10). Each panel has IN/OUT parts allowing you to connect different parts of your code.

When doing data science, we usually want to test several things at the same time: different models on the same dataset, or different models using different features, or different sub-analysis focusing on specific things.

Irrespective of whether we use Python or R, most IDEs are not really designed for that, as they are intended to run a linear script from start to end. To some extent, Jupyter notebooks can mitigate this problem, allowing us to separate the code into different areas. However this doesn’t take us very far, as we typically want to test different variations of these sub-models. In that case, its really hard to navigate through a notebook containing all those.

Prython is a new IDE allowing you to drop panels into a canvas, put R or Python code as you would normally do, and connect those panels to each other. It can be downloaded for free on www.prython.com

In this simple example* (see image above) we have a panel that creates the training data (in this case we use the standard iris dataset), and three panels connected to the OUT part. It means that everything created in that initial panel, will be available in the three panels below. We separated our code in the following way: in the lower left one we put one Keras model, in the centre one we put another Keras model, and in the third one (right) we put a scikit-learn model.

Each panel can run in three modes, noted by the three blue carets on each panel: only that panel, up to that panel (all the panels connected to IN), or all the panels that use its outputs (all the panels connected to OUT). In this case we can just go to the first panel on the top left part, and click on >>. That will execute that panel, and the three panels below. Note that all the logs are update accordingly, and the plot is created next to the panel that created it.

Its worth nothing that the exact same logic applies to when we run panels in R. Finally note that even though the intention of this exercise was to show how we can use this to “test” different models, we can also use it to run a single “linear” script; but allowing us to separate the code in different areas. For example we could put the input preparation in a panel, the model in a different panel, and the outputs saving part in another one. And obviously none of this restricts us to use it just for ML/data science, whatever script we have in R or Python can be executed here.

Navigating through a project in prython. Panels can be adjusted to hold all your code

*this is actually one of the sample projects included in prython

--

--

francisco juretig
0 Followers

random thoughts about data science