Skip to content

Recipes

Recipes

Interact with recipes in the Driverless AI server.

data property

Interact with data recipes in the Driverless AI server.

Returns:

explainers property

explainers: ExplainerRecipes

Interact with explainer recipes in the Driverless AI server.

Returns:

individuals property

individuals: IndividualRecipes

Interact with individual recipes in the Driverless AI server.

Driverless AI version requirement

Requires Driverless AI server 1.10.2 or higher.

Returns:

models property

models: ModelRecipes

Interact with model recipes in the Driverless AI server.

Returns:

pre_transformers property

pre_transformers: PreTransformerRecipes

Interact with pre-transformer recipes in the Driverless AI server.

Returns:

scorers property

scorers: ScorerRecipes

Interact with scorer recipes in the Driverless AI server.

Returns:

transformers property

transformers: TransformerRecipes

Interact with transformer recipes in the Driverless AI server.

Returns:

create

create(recipe: str, username: str = None, password: str = None) -> Recipe

Creates a custom recipe in the Driverless AI server.

Parameters:

  • recipe (str) –

    The path or URL to the recipe.

  • username (str, default: None ) –

    Username to use when connecting to BitBucket.

  • password (str, default: None ) –

    Password to use when connecting to BitBucket.

Returns:

  • Recipe

    Created custom recipe.

Example
recipe = client.recipes.create(
    recipe="https://github.com/h2oai/driverlessai-recipes/blob/master/scorers/regression/explained_variance.py"
)

create_async

create_async(
    recipe: str, username: str | None = None, password: str | None = None
) -> RecipeJob

Launches the creation of a custom recipe in the Driverless AI server.

Parameters:

  • recipe (str) –

    The path or URL to the recipe.

  • username (str | None, default: None ) –

    Username to use when connecting to BitBucket.

  • password (str | None, default: None ) –

    Password to use when connecting to BitBucket.

Returns:

  • RecipeJob

    Started the custome recipe job.

Example
recipe_job = client.recipes.create_async(
    recipe="https://github.com/h2oai/driverlessai-recipes/blob/master/scorers/regression/explained_variance.py"
)

DataRecipes

Interact with data recipes in the Driverless AI server.

list

list() -> Sequence[DataRecipe]

Retrieves data recipes in the Driverless AI server.

Returns:

Example
# Get names of all data recipes.
data_recipes = [r.name for r in client.recipes.data.list()]

# Get custom data recipes.
custom_data_recipes = [
    r for r in client.recipes.data.list() if r.is_custom
]

DataRecipe

Bases: Recipe

A data recipe in the Driverless AI server.

code property

code: str

Python code of the custom recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

is_active property

is_active: bool

Whether the recipe is active or not.

Returns:

is_custom property

is_custom: bool

Whether the recipe is a custom recipe or not.

Returns:

key property

key: str

Unique key of the recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

name property

name: str

Name of the entity.

Returns:

activate

activate() -> Recipe

Activates the custom recipe if it is inactive, and returns the newly activated custom recipe.

Returns:

  • Recipe

    Activated custom recipe.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already active.

deactivate

deactivate() -> None

Deactivates the custom recipe if it is active.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already inactive.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

update_code

update_code(code: str) -> Recipe

Updates the code of the custom recipe and returns the newly created recipe with the updated code.

Returns:

  • Recipe

    Updated custom recipe.

Raises:

  • InvalidOperationException

    if the recipe is not a custom one.

ExplainerRecipes

Interact with explainer recipes in the Driverless AI server.

list

Retrieves explainer recipes in the Driverless AI server.

Example
# Get all binomial explainer recipes.
binomial_explainers = [
    r for r in client.recipes.explainers.list() if r.for_binomial
]

# Get all multiclass explainer recipes.
multiclass_explainers = [
    r for r in client.recipes.explainers.list() if r.for_multiclass
]

# Get all regression explainer recipes.
regression_explainers = [
    r for r in client.recipes.explainers.list() if r.for_regression
]

# Get all IID explainer recipes.
iid_explainers = [
    r for r in client.recipes.explainers.list() if r.for_iid
]

# Get all time series explainer recipes.
time_series_explainers = [
    r for r in client.recipes.explainers.list() if r.for_timeseries
]

# Get all custom explainer recipes.
custom_explainers = [
    r for r in client.recipes.explainers.list() if r.is_custom
]

ExplainerRecipe

Bases: Recipe

An explainer recipe in the Driverless AI server.

code property

code: str

Python code of the custom recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

for_binomial property

for_binomial: bool

True if explainer works for binomial models.

Returns:

for_iid property

for_iid: bool

True if explainer works for I.I.D. models.

Returns:

for_multiclass property

for_multiclass: bool

True if explainer works for multiclass models.

Returns:

for_regression property

for_regression: bool

True if explainer works for regression models.

Returns:

for_timeseries property

for_timeseries: bool

True if explainer works for time series models.

Returns:

id property

id: str

Identifier.

Returns:

is_active property

is_active: bool

Whether the recipe is active or not.

Returns:

is_custom property

is_custom: bool

Whether the recipe is a custom recipe or not.

Returns:

key property

key: str

Unique key of the recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

name property

name: str

Name of the entity.

Returns:

settings property

settings: dict[str, Any]

Settings of the explainer.

Returns:

activate

activate() -> Recipe

Activates the custom recipe if it is inactive, and returns the newly activated custom recipe.

Returns:

  • Recipe

    Activated custom recipe.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already active.

deactivate

deactivate() -> None

Deactivates the custom recipe if it is active.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already inactive.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

search_settings

search_settings(
    search_term: str = "",
    show_description: bool = False,
    show_dai_name: bool = False,
    show_valid_values: bool = False,
) -> Table

Searches for explainer settings.

Parameters:

  • search_term (str, default: '' ) –

    Case insensitive term to search for.

  • show_description (bool, default: False ) –

    Whether to include description of the setting in results.

  • show_dai_name (bool, default: False ) –

    Whether to include setting name used by the Driverless AI server.

  • show_valid_values (bool, default: False ) –

    Whether to include the valid values that can be set for each setting.

Returns:

  • Table

    Matching explainer settings in a table.

Example
results = explainer_recipe.search_settings(search_term)
print(results)

show_settings

show_settings(show_dai_name: bool = False) -> Table

Displays the settings of the explainer with their corresponding values.

Parameters:

  • show_dai_name (bool, default: False ) –

    Whether to include setting name used by the Driverless AI server.

Returns:

  • Table

    Settings of the explainer in a table.

Example
settings = explainer_recipe.show_settings()
print(settings)

update_code

update_code(code: str) -> Recipe

Updates the code of the custom recipe and returns the newly created recipe with the updated code.

Returns:

  • Recipe

    Updated custom recipe.

Raises:

  • InvalidOperationException

    if the recipe is not a custom one.

with_settings

with_settings(validate_value: bool = True, **kwargs: Any) -> ExplainerRecipe

Updates the settings of the explainer recipe.

Parameters:

Returns:

IndividualRecipes

Interact with individual recipes in the Driverless AI server.

list

Retrieves individual recipes in the Driverless AI server.

Returns:

Example
# Get all binary individual recipes.
binomial_individuals = [
    r for r in client.recipes.individuals.list() if r.for_binary
]

# Get all multiclass individual recipes.
multiclass_individuals = [
    r for r in client.recipes.individuals.list() if r.for_multiclass
]

# Get all regression individual recipes.
regression_individuals = [
    r for r in client.recipes.individuals.list() if r.for_regression
]

# Get all custom individual recipes.
custom_individuals = [
    r for r in client.recipes.individuals.list() if r.is_custom
]

IndividualRecipe

Bases: Recipe

An individual recipe in the Driverless AI server.

code property

code: str

Python code of the custom recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

experiment_description property

experiment_description: str

Recipe experiment description.

Returns:

experiment_id property

experiment_id: str

Recipe experiment ID.

Returns:

for_binary property

for_binary: bool

True if recipe is for binary

Returns:

for_multiclass property

for_multiclass: bool

True if recipe is for multiclass

Returns:

for_regression property

for_regression: bool

True if recipe is for regression

Returns:

is_active property

is_active: bool

Whether the recipe is active or not.

Returns:

is_custom property

is_custom: bool

Whether the recipe is a custom recipe or not.

Returns:

key property

key: str

Unique key of the recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

name property

name: str

Name of the entity.

Returns:

activate

activate() -> Recipe

Activates the custom recipe if it is inactive, and returns the newly activated custom recipe.

Returns:

  • Recipe

    Activated custom recipe.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already active.

deactivate

deactivate() -> None

Deactivates the custom recipe if it is active.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already inactive.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

update_code

update_code(code: str) -> Recipe

Updates the code of the custom recipe and returns the newly created recipe with the updated code.

Returns:

  • Recipe

    Updated custom recipe.

Raises:

  • InvalidOperationException

    if the recipe is not a custom one.

ModelRecipes

Interact with model recipes in the Driverless AI server.

list

list() -> Sequence[ModelRecipe]

Retrieves model recipes in the Driverless AI server.

Returns:

Example
# Get all model recipes.
model_recipes = [
    r for r in client.recipes.models.list() if r.for_regression
]

# Get all custom model recipes.
custom_model_recipes = [
    r for r in client.recipes.models.list() if r.is_custom
]

ModelRecipe

Bases: Recipe

A model recipe in the Driverless AI server.

code property

code: str

Python code of the custom recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

is_active property

is_active: bool

Whether the recipe is active or not.

Returns:

is_custom property

is_custom: bool

Whether the recipe is a custom recipe or not.

Returns:

is_unsupervised property

is_unsupervised: bool

True if recipe doesn't require a target column.

Returns:

key property

key: str

Unique key of the recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

name property

name: str

Name of the entity.

Returns:

activate

activate() -> Recipe

Activates the custom recipe if it is inactive, and returns the newly activated custom recipe.

Returns:

  • Recipe

    Activated custom recipe.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already active.

deactivate

deactivate() -> None

Deactivates the custom recipe if it is active.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already inactive.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

update_code

update_code(code: str) -> Recipe

Updates the code of the custom recipe and returns the newly created recipe with the updated code.

Returns:

  • Recipe

    Updated custom recipe.

Raises:

  • InvalidOperationException

    if the recipe is not a custom one.

ScorerRecipes

Interact with scorer recipes in the Driverless AI server.

list

Retrieves scorer recipes in the Driverless AI server.

Returns:

Example
# Get all binomial scorer recipes.
binomial_scorers = [
    r for r in client.recipes.scorers.list() if r.for_binomial
]

# Get all multiclass scorer recipes.
multiclass_scorers = [
    r for r in client.recipes.scorers.list() if r.for_multiclass
]

# Get all regression scorer recipes.
regression_scorers = [
    r for r in client.recipes.scorers.list() if r.for_regression
]

# Get all custom scorer recipes.
custom_scorers = [r for r in client.recipes.scorers.list() if r.is_custom]

ScorerRecipe

Bases: Recipe

A scorer recipe in the Driverless AI server.

code property

code: str

Python code of the custom recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

description property

description: str

Description of the recipe.

Returns:

for_binomial property

for_binomial: bool

True if scorer works for binomial models.

Returns:

for_multiclass property

for_multiclass: bool

True if scorer works for multiclass models.

Returns:

for_regression property

for_regression: bool

True if scorer works for regression models.

Returns:

is_active property

is_active: bool

Whether the recipe is active or not.

Returns:

is_custom property

is_custom: bool

Whether the recipe is a custom recipe or not.

Returns:

key property

key: str

Unique key of the recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

name property

name: str

Name of the entity.

Returns:

activate

activate() -> Recipe

Activates the custom recipe if it is inactive, and returns the newly activated custom recipe.

Returns:

  • Recipe

    Activated custom recipe.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already active.

deactivate

deactivate() -> None

Deactivates the custom recipe if it is active.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already inactive.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

update_code

update_code(code: str) -> Recipe

Updates the code of the custom recipe and returns the newly created recipe with the updated code.

Returns:

  • Recipe

    Updated custom recipe.

Raises:

  • InvalidOperationException

    if the recipe is not a custom one.

TransformerRecipes

Interact with transformer recipes in the Driverless AI server.

list

Retrieves transformer recipes in the Driverless AI server.

Returns:

Example

```py

Get names of all transformers.

transformers = [r.name for r in client.recipes.transformers.list()]

Get custom transformers.

custom_transformers = [ r for r in client.recipes.transformers.list() if r.is_custom ]

```

TransformerRecipe

Bases: Recipe

A transformer recipe in the Driverless AI server.

code property

code: str

Python code of the custom recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

is_active property

is_active: bool

Whether the recipe is active or not.

Returns:

is_custom property

is_custom: bool

Whether the recipe is a custom recipe or not.

Returns:

key property

key: str

Unique key of the recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

name property

name: str

Name of the entity.

Returns:

activate

activate() -> Recipe

Activates the custom recipe if it is inactive, and returns the newly activated custom recipe.

Returns:

  • Recipe

    Activated custom recipe.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already active.

deactivate

deactivate() -> None

Deactivates the custom recipe if it is active.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already inactive.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

update_code

update_code(code: str) -> Recipe

Updates the code of the custom recipe and returns the newly created recipe with the updated code.

Returns:

  • Recipe

    Updated custom recipe.

Raises:

  • InvalidOperationException

    if the recipe is not a custom one.

PreTransformerRecipes

Interact with pre-transformer recipes in the Driverless AI server.

list

Retrieves pre-transformer recipes in the Driverless AI server.

Returns:

Example

```py

Get names of all pre-transformers.

pre_transformers = [r.name for r in client.recipes.pre_transformers.list()]

Get custom pre-transformers.

custom_pre_transformers = [ r for r in client.recipes.pre_transformers.list() if r.is_custom ]

```

PreTransformerRecipe

Bases: Recipe

A pre-transformer recipe in the Driverless AI server.

code property

code: str

Python code of the custom recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

is_active property

is_active: bool

Whether the recipe is active or not.

Returns:

is_custom property

is_custom: bool

Whether the recipe is a custom recipe or not.

Returns:

key property

key: str

Unique key of the recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

name property

name: str

Name of the entity.

Returns:

activate

activate() -> Recipe

Activates the custom recipe if it is inactive, and returns the newly activated custom recipe.

Returns:

  • Recipe

    Activated custom recipe.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already active.

deactivate

deactivate() -> None

Deactivates the custom recipe if it is active.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already inactive.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

update_code

update_code(code: str) -> Recipe

Updates the code of the custom recipe and returns the newly created recipe with the updated code.

Returns:

  • Recipe

    Updated custom recipe.

Raises:

  • InvalidOperationException

    if the recipe is not a custom one.

RecipeJob

Monitor the creation of a custom recipe in the Driverless AI server.

key property

key: str

Universally unique key of the entity.

Returns:

name property

name: str

Name of the entity.

Returns:

is_complete

is_complete() -> bool

Whether the job has been completed successfully.

Returns:

  • bool

    True if the job has been completed successfully, otherwise False.

is_running

is_running() -> bool

Whether the job has been scheduled or is running, finishing, or syncing.

Returns:

  • bool

    True if the job has not completed yet, otherwise False.

result

result(silent: bool = False) -> Recipe | None

Awaits the job's completion before returning the created custom recipe.

Parameters:

  • silent (bool, default: False ) –

    Whether to display status updates or not.

Returns:

  • Recipe | None

    Created custom recipe by the job.

Raises:

status

status(verbose: int = 0) -> str

Returns the status of the job.

Parameters:

  • verbose (int, default: 0 ) –
    • 0: A short description.
    • 1: A short description with a progress percentage.
    • 2: A detailed description with a progress percentage.

Returns:

  • str

    Current status of the job.

Recipe

A recipe in the Driverless AI server.

code property

code: str

Python code of the custom recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

is_active property

is_active: bool

Whether the recipe is active or not.

Returns:

is_custom property

is_custom: bool

Whether the recipe is a custom recipe or not.

Returns:

key property

key: str

Unique key of the recipe.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

Returns:

name property

name: str

Name of the entity.

Returns:

activate

activate() -> Recipe

Activates the custom recipe if it is inactive, and returns the newly activated custom recipe.

Returns:

  • Recipe

    Activated custom recipe.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already active.

deactivate

deactivate() -> None

Deactivates the custom recipe if it is active.

Raises:

  • InvalidOperationException

    If the recipe is a non-custom recipe.

  • InvalidStateException

    If the recipe is already inactive.

Driverless AI version requirement

Requires Driverless AI server 1.10.3 or higher.

update_code

update_code(code: str) -> Recipe

Updates the code of the custom recipe and returns the newly created recipe with the updated code.

Returns:

  • Recipe

    Updated custom recipe.

Raises:

  • InvalidOperationException

    if the recipe is not a custom one.