Skip to main content

experiments

Creates, updates, deletes, gets or lists an experiments resource.

Overview

Nameexperiments
TypeResource
Iddatabricks_workspace.ml.experiments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
experimentobjectAn experiment and its metadata.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_nameselectexperiment_name, deployment_nameGets metadata for an experiment.
getselectexperiment_id, deployment_nameGets metadata for an experiment. This method works on deleted experiments.
listselectdeployment_namemax_results, page_token, view_typeGets a list of all experiments.
createinsertdeployment_name, nameCreates an experiment with a name. Returns the ID of the newly created experiment. Validates that
deleteexecdeployment_name, experiment_idMarks an experiment and associated metadata, runs, metrics, params, and tags for deletion. If the
restoreexecdeployment_name, experiment_idRestore an experiment marked for deletion. This also restores associated metadata, runs, metrics,
searchexecdeployment_nameSearches for experiments that satisfy specified search criteria.
set_tagexecdeployment_name, experiment_id, key, valueSets a tag on an experiment. Experiment tags are metadata that can be updated.
updateexecdeployment_name, experiment_idUpdates experiment metadata.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
experiment_idstringID of the associated experiment.
experiment_namestringName of the associated experiment.
max_resultsintegerMaximum number of experiments desired. If max_results is unspecified, return all experiments. If max_results is too large, it'll be automatically capped at 1000. Callers of this endpoint are encouraged to pass max_results explicitly and leverage page_token to iterate through experiments.
page_tokenstringToken indicating the page of experiments to fetch
view_typestringQualifier for type of experiments to be returned. If unspecified, return only active experiments.

SELECT examples

Gets metadata for an experiment.

SELECT
experiment
FROM databricks_workspace.ml.experiments
WHERE experiment_name = '{{ experiment_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Creates an experiment with a name. Returns the ID of the newly created experiment. Validates that

INSERT INTO databricks_workspace.ml.experiments (
name,
artifact_location,
tags,
deployment_name
)
SELECT
'{{ name }}' /* required */,
'{{ artifact_location }}',
'{{ tags }}',
'{{ deployment_name }}'
RETURNING
experiment_id
;

Lifecycle Methods

Marks an experiment and associated metadata, runs, metrics, params, and tags for deletion. If the

EXEC databricks_workspace.ml.experiments.delete 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"experiment_id": "{{ experiment_id }}"
}'
;