Skip to main content

experiments

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

Overview

Nameexperiments
TypeResource
Iddatabricks_workspace.machinelearning.experiments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestring
experiment_idstring
artifact_locationstring
creation_timeinteger
last_update_timeinteger
lifecycle_stagestring
tagsarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
searchexperimentsselectdeployment_nameSearches for experiments that satisfy specified search criteria.
listexperimentsselectdeployment_nameGets a list of all experiments.
getexperimentselectdeployment_nameGets metadata for an experiment. This method works on deleted experiments.
getbynameselectdeployment_nameGets metadata for an experiment.
createexperimentinsertdeployment_nameCreates an experiment with a name. Returns the ID of the newly created experiment. Validates that another experiment with the same name does not already exist and fails if another experiment with the same name already exists.
updateexperimentupdatedeployment_nameUpdates experiment metadata.
deleteexperimentdeletedeployment_nameMarks an experiment and associated metadata, runs, metrics, params, and tags for deletion. If the experiment uses FileStore, artifacts associated with experiment are also deleted.
restoreexperimentexecdeployment_nameRestore an experiment marked for deletion. This also restores associated metadata, runs, metrics, params, and tags. If experiment uses FileStore, underlying artifacts associated with experiment are also restored.

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)

SELECT examples

Searches for experiments that satisfy specified search criteria.

SELECT
name,
experiment_id,
artifact_location,
creation_time,
last_update_time,
lifecycle_stage,
tags
FROM databricks_workspace.machinelearning.experiments
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates an experiment with a name. Returns the ID of the newly created experiment. Validates that another experiment with the same name does not already exist and fails if another experiment with the same name already exists.

INSERT INTO databricks_workspace.machinelearning.experiments (
data__name,
data__artifact_location,
data__tags,
deployment_name
)
SELECT
'{{ name }}',
'{{ artifact_location }}',
'{{ tags }}',
'{{ deployment_name }}'
RETURNING
experiment_id
;

UPDATE examples

Updates experiment metadata.

UPDATE databricks_workspace.machinelearning.experiments
SET
data__experiment_id = '{{ experiment_id }}',
data__new_name = '{{ new_name }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Marks an experiment and associated metadata, runs, metrics, params, and tags for deletion. If the experiment uses FileStore, artifacts associated with experiment are also deleted.

DELETE FROM databricks_workspace.machinelearning.experiments
WHERE deployment_name = '{{ deployment_name }}' --required;

Lifecycle Methods

Restore an experiment marked for deletion. This also restores associated metadata, runs, metrics, params, and tags. If experiment uses FileStore, underlying artifacts associated with experiment are also restored.

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