How to create a WhizzML script – Part 1

Posted by

WhizzML is a Domain-Specific Language (DSL) developed by BigML. It is a powerful tool for automating Machine Learning (ML) workflows and implementing high-level ML algorithms. In this series of blog posts, you will learn WhizzML from scratch. In this post, we’ll explain where to find WhizzML scripts and how you can use them. Let’s start!


What is a script?

First, we’ll remind you of some definitions to clarify some important WhizzML concepts.

A workflow is the series of activities that are necessary to solve a ML problem by using the resources provided by BigML.

A script is a workflow specification that uses WhizzML source code.

A library is a shared collection of WhizzML functions and definitions usable by any script that imports them.

An execution is a specific run of a script, i.e., the actual realization of all the steps codified by its WhizzML source.

You may be wondering what’s inside a WhizzML script and how it’s structured. Let’s discover that next. WhizzML scripts have four components:

  • Source: the original script, the code creating the WhizzML script itself
  • Imports: the list of libraries with the code used by the script
  • Inputs: the list of input values that parameterize the workflow
  • Outputs: the list of values computed by the script and returned to the user


How to create a WhizzML script?

There are different ways to create a WhizzML script depending on what tools you use. BigML offers several options:

  • Gallery
  • Scriptify
  • Script editor
  • Github
  • BigMLer

We’ll focus on the Gallery and the Scriptify methods in this blog post. You’ll learn how to use the other methods in future blog posts. BigML provides a public Gallery with scripts, datasets and models for your benefit. By choosing a resource and cloning it, you will have it in your Dashboard, where you can run it or create an execution. The Gallery is great to get inspired by high-level Workflows from other users. It can also save you time by eliminating the need to recreate basic scripts from scratch.

Scriptify is another convenient tool for creating scripts. With Scriptify, you can create a WhizzML script for any Machine Learning workflow in a single click. All BigML resources (datasets, models, evaluations, etc.) have a menu option named Scriptify that allows you to automatically generate a script that can regenerate a resource (or generate a similar one if it is used with different inputs but with the same field structure). Here is an example of Scriptify appliable to a Model resource.


What about the Execution?

Executing a WhizzML script is easy. Given a script and a complete set of inputs, you can execute your workflow and watch it generate the output. There are also different tools you can use to do just that:

  • Web UI
  • BigMLer
  • Bindings

Let’s focus on the first method and leave the others for later blog posts. When you’re in the Dashboard you can go to the WhizzML menu, where you will find your scripts, libraries and executions.


Let’s use the script we just imported from the Gallery as an example of an execution. In this script, we just have to choose one input before we execute it. Once it finishes, we will find it under “Executions”. You can then find the output information, seen below with the name “result“. You can also see the resources that have been created to execute this script under Resources section. You can execute a script as many times as you want in a repeatable and traceable way.

How to add a script to the resources menu?

You can easily add a script to your resources menu. This lets you use your favorite scripts as many times as you want. Simply follow these steps:

  1. When you’re viewing a script, find the option “Add a Script to this Menu” on the top right.4_Menu1
  2. Choose the resource this script is for, e.g., Datasets, Models, Ensembles, Evaluations
  3. Once added, you can find it in the script menu of that resource view. For example, if I add a script for datasets, I will be able to use it in the Dataset tab. The ability to use the same script many times helps you get more productive.4_Menu5

Now you know the basics of creating a WhizzML script, but this is just the beginning. In the next post, we’ll discover other ways to create and use scripts.

One comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s