@Generated public class ExperimentsAPI extends Object
Experiments are located in the workspace file tree. You manage experiments using the same tools you use to manage other workspace objects such as folders, notebooks, and libraries.
| Constructor and Description |
|---|
ExperimentsAPI(ApiClient apiClient)
Regular-use constructor
|
ExperimentsAPI(ExperimentsService mock)
Constructor for mocks
|
| Modifier and Type | Method and Description |
|---|---|
CreateExperimentResponse |
createExperiment(CreateExperiment request)
Creates an experiment with a name.
|
CreateLoggedModelResponse |
createLoggedModel(CreateLoggedModelRequest request)
Create a logged model.
|
CreateRunResponse |
createRun(CreateRun request)
Creates a new run within an experiment.
|
void |
deleteExperiment(DeleteExperiment request)
Marks an experiment and associated metadata, runs, metrics, params, and tags for deletion.
|
void |
deleteLoggedModel(DeleteLoggedModelRequest request)
Delete a logged model.
|
void |
deleteLoggedModel(String modelId) |
void |
deleteLoggedModelTag(DeleteLoggedModelTagRequest request)
Delete a tag on a logged model.
|
void |
deleteLoggedModelTag(String modelId,
String tagKey) |
void |
deleteRun(DeleteRun request)
Marks a run for deletion.
|
DeleteRunsResponse |
deleteRuns(DeleteRuns request)
Bulk delete runs in an experiment that were created prior to or at the specified timestamp.
|
void |
deleteTag(DeleteTag request)
Deletes a tag on a run.
|
FinalizeLoggedModelResponse |
finalizeLoggedModel(FinalizeLoggedModelRequest request)
Finalize a logged model.
|
GetExperimentByNameResponse |
getByName(GetByNameRequest request)
Gets metadata for an experiment.
|
GetExperimentByNameResponse |
getByName(String experimentName) |
GetExperimentResponse |
getExperiment(GetExperimentRequest request)
Gets metadata for an experiment.
|
GetExperimentResponse |
getExperiment(String experimentId) |
Iterable<Metric> |
getHistory(GetHistoryRequest request)
Gets a list of all values for the specified metric for a given run.
|
Iterable<Metric> |
getHistory(String metricKey) |
GetLoggedModelResponse |
getLoggedModel(GetLoggedModelRequest request)
Get a logged model.
|
GetLoggedModelResponse |
getLoggedModel(String modelId) |
GetExperimentPermissionLevelsResponse |
getPermissionLevels(GetExperimentPermissionLevelsRequest request)
Gets the permission levels that a user can have on an object.
|
GetExperimentPermissionLevelsResponse |
getPermissionLevels(String experimentId) |
ExperimentPermissions |
getPermissions(GetExperimentPermissionsRequest request)
Gets the permissions of an experiment.
|
ExperimentPermissions |
getPermissions(String experimentId) |
GetRunResponse |
getRun(GetRunRequest request)
Gets the metadata, metrics, params, and tags for a run.
|
GetRunResponse |
getRun(String runId) |
ExperimentsService |
impl() |
Iterable<FileInfo> |
listArtifacts(ListArtifactsRequest request)
List artifacts for a run.
|
Iterable<Experiment> |
listExperiments(ListExperimentsRequest request)
Gets a list of all experiments.
|
void |
logBatch(LogBatch request)
Logs a batch of metrics, params, and tags for a run.
|
void |
logInputs(LogInputs request)
Logs inputs, such as datasets and models, to an MLflow Run.
|
void |
logLoggedModelParams(LogLoggedModelParamsRequest request)
Logs params for a logged model.
|
void |
logMetric(LogMetric request)
Log a metric for a run.
|
void |
logModel(LogModel request)
**Note:** the [Create a logged model](/api/workspace/experiments/createloggedmodel) API
replaces this endpoint.
|
void |
logOutputs(LogOutputsRequest request)
Logs outputs, such as models, from an MLflow Run.
|
void |
logParam(LogParam request)
Logs a param used for a run.
|
void |
restoreExperiment(RestoreExperiment request)
Restore an experiment marked for deletion.
|
void |
restoreRun(RestoreRun request)
Restores a deleted run.
|
RestoreRunsResponse |
restoreRuns(RestoreRuns request)
Bulk restore runs in an experiment that were deleted no earlier than the specified timestamp.
|
Iterable<Experiment> |
searchExperiments(SearchExperiments request)
Searches for experiments that satisfy specified search criteria.
|
SearchLoggedModelsResponse |
searchLoggedModels(SearchLoggedModelsRequest request)
Search for Logged Models that satisfy specified search criteria.
|
Iterable<Run> |
searchRuns(SearchRuns request)
Searches for runs that satisfy expressions.
|
void |
setExperimentTag(SetExperimentTag request)
Sets a tag on an experiment.
|
void |
setLoggedModelTags(SetLoggedModelTagsRequest request)
Set tags for a logged model.
|
ExperimentPermissions |
setPermissions(ExperimentPermissionsRequest request)
Sets permissions on an object, replacing existing permissions if they exist.
|
void |
setTag(SetTag request)
Sets a tag on a run.
|
void |
updateExperiment(UpdateExperiment request)
Updates experiment metadata.
|
ExperimentPermissions |
updatePermissions(ExperimentPermissionsRequest request)
Updates the permissions on an experiment.
|
UpdateRunResponse |
updateRun(UpdateRun request)
Updates run metadata.
|
public ExperimentsAPI(ApiClient apiClient)
public ExperimentsAPI(ExperimentsService mock)
public CreateExperimentResponse createExperiment(CreateExperiment request)
Throws `RESOURCE_ALREADY_EXISTS` if an experiment with the given name exists.
public CreateLoggedModelResponse createLoggedModel(CreateLoggedModelRequest request)
public CreateRunResponse createRun(CreateRun request)
public void deleteExperiment(DeleteExperiment request)
public void deleteLoggedModel(String modelId)
public void deleteLoggedModel(DeleteLoggedModelRequest request)
public void deleteLoggedModelTag(DeleteLoggedModelTagRequest request)
public void deleteRun(DeleteRun request)
public DeleteRunsResponse deleteRuns(DeleteRuns request)
public void deleteTag(DeleteTag request)
public FinalizeLoggedModelResponse finalizeLoggedModel(FinalizeLoggedModelRequest request)
public GetExperimentByNameResponse getByName(String experimentName)
public GetExperimentByNameResponse getByName(GetByNameRequest request)
This endpoint will return deleted experiments, but prefers the active experiment if an active and deleted experiment share the same name. If multiple deleted experiments share the same name, the API will return one of them.
Throws `RESOURCE_DOES_NOT_EXIST` if no experiment with the specified name exists.
public GetExperimentResponse getExperiment(String experimentId)
public GetExperimentResponse getExperiment(GetExperimentRequest request)
public Iterable<Metric> getHistory(GetHistoryRequest request)
public GetLoggedModelResponse getLoggedModel(String modelId)
public GetLoggedModelResponse getLoggedModel(GetLoggedModelRequest request)
public GetExperimentPermissionLevelsResponse getPermissionLevels(String experimentId)
public GetExperimentPermissionLevelsResponse getPermissionLevels(GetExperimentPermissionLevelsRequest request)
public ExperimentPermissions getPermissions(String experimentId)
public ExperimentPermissions getPermissions(GetExperimentPermissionsRequest request)
public GetRunResponse getRun(String runId)
public GetRunResponse getRun(GetRunRequest request)
If there are multiple values with the latest timestamp, return the maximum of these values.
public Iterable<FileInfo> listArtifacts(ListArtifactsRequest request)
public Iterable<Experiment> listExperiments(ListExperimentsRequest request)
public void logBatch(LogBatch request)
In case of error (due to internal server error or an invalid request), partial data may be written.
You can write metrics, params, and tags in interleaving fashion, but within a given entity type are guaranteed to follow the order specified in the request body.
The overwrite behavior for metrics, params, and tags is as follows:
* Metrics: metric values are never overwritten. Logging a metric (key, value, timestamp) appends to the set of values for the metric with the provided key.
* Tags: tag values can be overwritten by successive writes to the same tag key. That is, if multiple tag values with the same key are provided in the same API request, the last-provided tag value is written. Logging the same tag (key, value) is permitted. Specifically, logging a tag is idempotent.
* Parameters: once written, param values cannot be changed (attempting to overwrite a param value will result in an error). However, logging the same param (key, value) is permitted. Specifically, logging a param is idempotent.
Request Limits ------------------------------- A single JSON-serialized API request may be up to 1 MB in size and contain:
* No more than 1000 metrics, params, and tags in total
* Up to 1000 metrics
* Up to 100 params
* Up to 100 tags
For example, a valid request might contain 900 metrics, 50 params, and 50 tags, but logging 900 metrics, 50 params, and 51 tags is invalid.
The following limits also apply to metric, param, and tag keys and values:
* Metric keys, param keys, and tag keys can be up to 250 characters in length
* Parameter and tag values can be up to 250 characters in length
public void logInputs(LogInputs request)
public void logLoggedModelParams(LogLoggedModelParamsRequest request)
public void logMetric(LogMetric request)
public void logModel(LogModel request)
Log a model to an MLflow Run.
public void logOutputs(LogOutputsRequest request)
public void logParam(LogParam request)
public void restoreExperiment(RestoreExperiment request)
Throws `RESOURCE_DOES_NOT_EXIST` if experiment was never created or was permanently deleted.
public void restoreRun(RestoreRun request)
Throws `RESOURCE_DOES_NOT_EXIST` if the run was never created or was permanently deleted.
public RestoreRunsResponse restoreRuns(RestoreRuns request)
public Iterable<Experiment> searchExperiments(SearchExperiments request)
public SearchLoggedModelsResponse searchLoggedModels(SearchLoggedModelsRequest request)
public Iterable<Run> searchRuns(SearchRuns request)
Search expressions can use `mlflowMetric` and `mlflowParam` keys.
public void setExperimentTag(SetExperimentTag request)
public void setLoggedModelTags(SetLoggedModelTagsRequest request)
public ExperimentPermissions setPermissions(ExperimentPermissionsRequest request)
public void setTag(SetTag request)
public void updateExperiment(UpdateExperiment request)
public ExperimentPermissions updatePermissions(ExperimentPermissionsRequest request)
public UpdateRunResponse updateRun(UpdateRun request)
public ExperimentsService impl()
Copyright © 2026. All rights reserved.