experiment_runs
Creates, updates, deletes, gets or lists an experiment_runs
resource.
Overview
Name | experiment_runs |
Type | Resource |
Id | databricks_workspace.machinelearning.experiment_runs |
Fields
The following fields are returned by SELECT
queries:
- searchruns
- getrun
Name | Datatype | Description |
---|---|---|
data | object | |
info | object | |
inputs | object |
Name | Datatype | Description |
---|---|---|
data | object | |
info | object | |
inputs | object |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
searchruns | select | deployment_name | Searches for runs that satisfy expressions. | |
getrun | select | deployment_name | Gets 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. | |
createrun | insert | deployment_name | 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 | |
updaterun | update | deployment_name | Updates run metadata. | |
deleteruns | delete | deployment_name | 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 | |
deleterun | delete | deployment_name | Marks a run for deletion. | |
logbatch | exec | deployment_name | 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). | |
loginputs | exec | deployment_name | Experimental: This API may change or be removed in a future release without warning. | |
logmetric | exec | deployment_name | Logs 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. | |
logmodel | exec | deployment_name | Experimental: This API may change or be removed in a future release without warning. | |
logparam | exec | deployment_name | Logs 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. | |
restorerun | exec | deployment_name | Restores a deleted run. | |
restoreruns | exec | deployment_name | Bulk 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.
Name | Datatype | Description |
---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
SELECT
examples
- searchruns
- getrun
Searches for runs that satisfy expressions.
SELECT
data,
info,
inputs
FROM databricks_workspace.machinelearning.experiment_runs
WHERE deployment_name = '{{ deployment_name }}' -- required;
Gets 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.
SELECT
data,
info,
inputs
FROM databricks_workspace.machinelearning.experiment_runs
WHERE deployment_name = '{{ deployment_name }}' -- required;
INSERT
examples
- createrun
- Manifest
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
;
# Description fields are for documentation purposes
- name: experiment_runs
props:
- name: deployment_name
value: string
description: Required parameter for the experiment_runs resource.
- name: experiment_id
value: string
- name: user_id
value: string
- name: start_time
value: integer
- name: tags
value: Array of object
UPDATE
examples
- updaterun
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
- deleteruns
- deleterun
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;
Marks a run for deletion.
DELETE FROM databricks_workspace.machinelearning.experiment_runs
WHERE deployment_name = '{{ deployment_name }}' --required;
Lifecycle Methods
- logbatch
- loginputs
- logmetric
- logmodel
- logparam
- restorerun
- restoreruns
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 }}"
}';
Experimental: This API may change or be removed in a future release without warning.
EXEC databricks_workspace.machinelearning.experiment_runs.loginputs
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": "{{ run_id }}",
"datasets": "{{ datasets }}"
}';
Logs 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.
EXEC databricks_workspace.machinelearning.experiment_runs.logmetric
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": "{{ run_id }}",
"run_uuid": "{{ run_uuid }}",
"key": "{{ key }}",
"value": "{{ value }}",
"timestamp": "{{ timestamp }}",
"step": "{{ step }}"
}';
Experimental: This API may change or be removed in a future release without warning.
EXEC databricks_workspace.machinelearning.experiment_runs.logmodel
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": "{{ run_id }}",
"model_json": "{{ model_json }}"
}';
Logs 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.
EXEC databricks_workspace.machinelearning.experiment_runs.logparam
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": "{{ run_id }}",
"run_uuid": "{{ run_uuid }}",
"key": "{{ key }}",
"value": "{{ value }}"
}';
Restores a deleted run.
EXEC databricks_workspace.machinelearning.experiment_runs.restorerun
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": "{{ run_id }}"
}';
Bulk 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
EXEC databricks_workspace.machinelearning.experiment_runs.restoreruns
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"experiment_id": "{{ experiment_id }}",
"min_timestamp_millis": "{{ min_timestamp_millis }}",
"max_runs": "{{ max_runs }}"
}';