Custom Recipe Management

The following sections describe custom recipe management in Driverless AI.

Understanding Custom Recipes

Custom recipes are Python code snippets that can be uploaded into Driverless AI at runtime like plugins. Restarting Driverless AI is not required. Custom recipes can be provided for transformers, models, and scorers. During training of a supervised machine learning modeling pipeline, Driverless AI can use these code snippets as building blocks in combination with or in place of built-in code pieces. When selecting recipes for an experiment in the Expert Settings panel, only custom recipes that are currently active are visible.

New datasets can be created by modifying an existing dataset with a data recipe. You can also apply data recipes as standalone recipes. Additionally, the set of MLI techniques and methodologies used in Driverless AI can be extended with recipes. For more information on MLI explainer recipes, see MLI Custom Recipes.

Note

  • In most cases, and especially for complex recipes, MOJO for model deployment is not available out of the box. However, it is possible to get the MOJO. Contact support@h2o.ai for more information about creating MOJOs for custom recipes.

  • The Python Scoring Pipeline for deployment has full support for custom recipes.

  • To enable Shapley calculations in MLI, custom model recipes must use the has_pred_contribs method. Refer to the model recipe template for more info.

Adding Custom Recipes

To add a custom recipe, go to the recipe management page by clicking Recipes in the top navigation, then click the Add Custom Recipes button. Select one of the following options from the drop-down menu that appears:

Add custom recipes
  • From computer: Add a custom recipe as a Python or ZIP file from your local file system.

  • From URL: Add a custom recipe from a URL.

  • From Bitbucket: Add a custom recipe from a Bitbucket repository. To use this option, your Bitbucket username and password must be provided along with the custom recipe Bitbucket URL.

    Add custom recipe from Bitbucket repository

Note

  • When uploading a new recipe, any recipes that share either the same class name or _display_name attribute are deactivated.

Managing Recipes

Two distinct views are available on this page:

  • List view: This view displays all available custom recipes. Only active recipes are listed by default, but deactivated recipes can also be viewed. For more information, see List View.

  • Detail view: This view lets you edit custom recipe code in Driverless AI and save the edited code. For more information, see Detail View.

List View

The following is a list of actions that you can take from the recipe list view:

General actions:

  • View deactivated recipes by selecting Include inactive recipes.

  • Deactivate a recipe by selecting it and clicking Deactivate \(x\) Item(s). You can use this option to deactivate multiple recipes at one time. Note that recipes can only be deactivated, not deleted.

  • Search and sort recipes. Note that if enough recipes are uploaded, they are listed on multiple pages.

  • Select which columns are visible on the list view.

Recipes list view

Recipe-specific actions:

  • Open: View a specific recipe in detail.

  • Edit note: Create or edit a note for a recipe to keep track of its functionality.

  • Deactivate: Deactivate the selected recipe.

  • Apply on Dataset (For data recipes only): Apply an existing data recipe to the dataset. For more information on modifying datasets with data recipes, see Modify by custom data recipe.

  • Apply Without Dataset (For data recipes only): Apply the selected data recipe as a standalone recipe.

Recipes-specific actions

Detail View

The following is a list of actions that you can take from the recipe detail view:

  • Edit custom recipe code. To save the edited recipe, click the Save as New Recipe and Activate button. If you change both the ClassName and _display_name defined in the recipe, then the old version of the recipe remains active. If you don’t change both the ClassName and _display_name defined in the recipe, the old version of the recipe is automatically deactivated when a new version is saved and activated. New versions of existing recipes keep references to the original recipes, letting you keep track of changes throughout multiple versions. You can also download recipe code and deactivate recipes from this view.

  • View the recipe’s name, type, ID, filename, creation date, and whether the recipe is currently active.

  • (For data recipes only) Apply the data recipe on a dataset or as a standalone recipe.

  • If a recipe was downloaded from an external URL, the link is displayed under Original URL.

  • More Actions drop-down:

    • Download the recipe by clicking Download.

    • Deactivate the recipe by clicking Deactivate. Note that recipes can only be deactivated, not deleted.

Recipes detail view

Note

If _display_name is not defined in a recipe, then that recipe’s display name is derived from the ClassName defined in the recipe.

Additional Resources