PyDarwin Designer, a prototype, user friendly interface to pyDarwin for machine learning based model selection.

pyDarwin(1) is a Python package with a command line API, designed for machine learning model selection in NONMEM and NLME. It doesn’t have a graphical user interface (GUI). Instead, it requires users to manually create three files: a template file, a tokens file, and an options file. The tokens and options files are formatted in JSON (JavaScript Object Notation), while the template file is in plain text. To simplify this process, the proposed pyDarwin Designer interface aims to provide a GUI that will assist users in generating these files more easily. pyDarwin Designer is a prototype user friendly R shiny application to facilitate the creation, validation, and syntax checking of the three required files for pyDarwin. A user-friendly GUI currently exists in Pirana >= 23.1.0 for creating and executing a pyDarwin search, however, the interface is limited to a set of ADVAN subroutines. pyDarwin Designer is a completely general solution to modeling, as users can add/edit NMTRAN (NONMEM) or PML (NLME) code directly in the GUI and create a search space without limitations. Knowledge of JSON syntax is not required. pyDarwin Designer is currently under development and is not yet released. The interface features a tab-based navigation structure for the three files, and tabs for output from the pyDarwin Reporter and analysis progress. Typically development of an analysis design would start with a very simple working NONMEM control file. This would be opened or pasted into the editor on the “Template and tokens” tab. Once this is done, tokens can be added by clicking the “Add Token Group” button (figure 1, red ellipse). The token stem for the token group can be provided, then the token text (green ellipse) can be added. The tokens, which are added to the template file are appended to the end of the template text (figure 1, blue ellipse).

Figure 1

From there the token text in the template can be dragged and dropped to the appropriate place in the template file text (figure 2, blue ellipse). The control file resulting from the currently selected token sets can be generated for examination by clicking the “View Current Control stream” button (figure 2, red ellipse).

Figure 2

A complete set of default options can be selected for each of the available algorithms in the “options” tab. These options can then be edited if needed. The analysis can then be run, the progress and intermediate output monitored and diagnostic plots generated (figure 3) from the DarwinReporter R Shiny application.

Figure 3

Use scenarios for pyDarwin would include large machine learning model selection, or very simple searches. For example, a search of 1 vs 2 compartment models with 4 different sets of initial estimates (2 each for V and CL) could be done rather than manually coding and executing all 8 models, making pyDarwinDesigner a general and efficient tool for most model development problems.

Li, X., (2024), pyDarwin: A Machine Learning Enhanced Automated Nonlinear Mixed-Effect Model Selection Toolbox. Clin Pharmacol Ther.