-
Notifications
You must be signed in to change notification settings - Fork 27
Batch‐creating Adaptive Model Reports
There are various options to create an ADM Health Check or individual Model Report as detailed here.
When you want to create many model reports, and frequently want to update them because new data is available, it can be convenient to run a batch script instead.
The reports are just Quarto Notebooks (for the Python versions), or R Markdown (for the R versions), which take arguments and can be called from a script. The script can be in any scripting language, bash, zsh, python, or R etc. The advantage of using Python/R is that you can easily add a few lines of code to subset the data to the aspects you're interested in (e.g. certain configurations, certain issues) etc.
For the Python versions | For the R versions |
---|---|
Python | R |
Quarto and Pandoc | R Markdown and Pandoc but these come installed with R Studio. For our purposes the free version of R Studio is sufficient. |
PDSTools python library | PDS Tools library |
In addition, you'll need a clone of the Pega Data Scientist Tools repository from git, as this contains the notebooks and example scripts. You could of course also download just the files/scripts that you plan to use, but cloning the whole repository is easier and makes it easier to stay current with updates.
We have provided a few sample scripts to get you going. The scripts are rather self-explanatory.
The sample scripts can be found in the examples/datamart folder of the cloned repository.
Script | Purpose |
---|---|
create_health_check_python.sh | Shell script to create stand-alone Quarto/Python ADM Health Check |
create_health_check_R.sh | Shell script to create stand-alone Markdown/R ADM Health Check |
create_single_model_report_python.sh | Shell script to create stand-alone Quarto/Python model reports |
create_single_model_report_R.sh | Shell script to create stand-alone Markdown/R model reports |
batch_create_reports.R | Extensive example to create both the overall Health Check as well as individual model reports, generating both the Python and R versions with examples of customization. The script is written in R but it creates both the R and Python versions of the reports. You'll need both sets of prerequisites in order to run this. |