Skip to main content

experiment_runs

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

Overview

Nameexperiment_runs
TypeResource
Iddatabricks_workspace.machinelearning.experiment_runs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
dataobject
infoobject
inputsobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
searchrunsselectdeployment_nameSearches for runs that satisfy expressions.
getrunselectdeployment_nameGets the metadata, metrics, params, and tags for a run. In the case where multiple metrics with the same key are logged for a run, return only the value with the latest timestamp.
createruninsertdeployment_nameCreates a new run within an experiment. A run is usually a single execution of a machine learning or data ETL pipeline. MLflow uses runs to track the
updaterunupdatedeployment_nameUpdates run metadata.
deleterunsdeletedeployment_nameBulk delete runs in an experiment that were created prior to or at the specified timestamp. Deletes at most max_runs per request. To call this API from a Databricks Notebook in Python, you can use the client code snippet on
deleterundeletedeployment_nameMarks a run for deletion.
logbatchexecdeployment_nameLogs a batch of metrics, params, and tags for a run. If any data failed to be persisted, the server will respond with an error (non-200 status code).
loginputsexecdeployment_nameExperimental: This API may change or be removed in a future release without warning.
logmetricexecdeployment_nameLogs a metric for a run. A metric is a key-value pair (string key, float value) with an associated timestamp. Examples include the various metrics that represent ML model accuracy. A metric can be logged multiple times.
logmodelexecdeployment_nameExperimental: This API may change or be removed in a future release without warning.
logparamexecdeployment_nameLogs a param used for a run. A param is a key-value pair (string key, string value). Examples include hyperparameters used for ML model training and constant dates and values used in an ETL pipeline. A param can be logged only once for a run.
restorerunexecdeployment_nameRestores a deleted run.
restorerunsexecdeployment_nameBulk restore runs in an experiment that were deleted no earlier than the specified timestamp. Restores at most max_runs per request. To call this API from a Databricks Notebook in Python, you can use the client code snippet on

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 runs that satisfy expressions.

SELECT
data,
info,
inputs
FROM databricks_workspace.machinelearning.experiment_runs
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new run within an experiment. A run is usually a single execution of a machine learning or data ETL pipeline. MLflow uses runs to track the

INSERT INTO databricks_workspace.machinelearning.experiment_runs (
data__experiment_id,
data__user_id,
data__start_time,
data__tags,
deployment_name
)
SELECT
'{{ experiment_id }}',
'{{ user_id }}',
{{ start_time }},
'{{ tags }}',
'{{ deployment_name }}'
RETURNING
run
;

UPDATE examples

Updates run metadata.

UPDATE databricks_workspace.machinelearning.experiment_runs
SET
data__run_id = '{{ run_id }}',
data__run_uuid = '{{ run_uuid }}',
data__status = '{{ status }}',
data__end_time = {{ end_time }}
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
run_info;

DELETE examples

Bulk delete runs in an experiment that were created prior to or at the specified timestamp. Deletes at most max_runs per request. To call this API from a Databricks Notebook in Python, you can use the client code snippet on

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

Lifecycle Methods

Logs a batch of metrics, params, and tags for a run. If any data failed to be persisted, the server will respond with an error (non-200 status code).

EXEC databricks_workspace.machinelearning.experiment_runs.logbatch 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": "{{ run_id }}",
"metrics": "{{ metrics }}",
"params": "{{ params }}",
"tags": "{{ tags }}"
}';