Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Create a WhizzML Script (Part 1)

DZone's Guide to

How to Create a WhizzML Script (Part 1)

In the first post of this series where you'll learn WhizzML from scratch, learn where to find WhizzML scripts and how you can use them.

· AI Zone
Free Resource

Find out how AI-Fueled APIs from Neura can make interesting products more exciting and engaging. 

WhizzML is a domain-specific language (DSL) developed by BigML. It's 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.

  • Workflow: The series of activities that are necessary to solve a machine learning problem by using the resources provided by BigML.

  • Script: A workflow specification that uses WhizzML source code.

  • Library: A shared collection of WhizzML functions and definitions usable by any script that imports them.

  • Execution: 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 explore that next. WhizzML scripts have four components:

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

3

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

Let's 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 for getting 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 applicable to a Model resource.

2_Scriptify

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.

7

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 the Resources section. You can execute a script as many times as you want in a repeatable and traceable way.

Image title

Image title

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.4_Menu1
  2. Choose the resource this script is for (i.e. 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 be 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.

To find out how AI-Fueled APIs can increase engagement and retention, download Six Ways to Boost Engagement for Your IoT Device or App with AI today.

Topics:
machine learning ,ai ,tutorial ,whizzml ,domain-specific languages ,algorithm ,script

Published at DZone with permission of Barbara Martin, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}