mlflow.entities

The mlflow.entities module defines entities returned by the MLflow REST API.

class mlflow.entities.Experiment(experiment_id, name, artifact_location, lifecycle_stage, tags=None)[source]

Experiment object.

DEFAULT_EXPERIMENT_NAME = 'Default'
property artifact_location

String corresponding to the root artifact URI for the experiment.

property experiment_id

String ID of the experiment.

classmethod from_proto(proto)[source]
property lifecycle_stage

Lifecycle stage of the experiment. Can either be ‘active’ or ‘deleted’.

property name

String name of the experiment.

property tags

Tags that have been set on the experiment.

to_proto()[source]
class mlflow.entities.FileInfo(path, is_dir, file_size)[source]

Metadata about a file or directory.

property file_size

Size of the file or directory. If the FileInfo is a directory, returns None.

classmethod from_proto(proto)[source]
property is_dir

Whether the FileInfo corresponds to a directory.

property path

String path of the file or directory.

to_proto()[source]
class mlflow.entities.Metric(key, value, timestamp, step)[source]

Metric object.

classmethod from_proto(proto)[source]
property key

String key corresponding to the metric name.

property step

Integer metric step (x-coordinate).

property timestamp

Metric timestamp as an integer (milliseconds since the Unix epoch).

to_proto()[source]
property value

Float value of the metric.

class mlflow.entities.Param(key, value)[source]

Parameter object.

classmethod from_proto(proto)[source]
property key

String key corresponding to the parameter name.

to_proto()[source]
property value

String value of the parameter.

class mlflow.entities.Run(run_info, run_data)[source]

Run object.

property data

The run data, including metrics, parameters, and tags.

Return type

mlflow.entities.RunData

classmethod from_proto(proto)[source]
property info

The run metadata, such as the run id, start time, and status.

Return type

mlflow.entities.RunInfo

to_dictionary()[source]
to_proto()[source]
class mlflow.entities.RunData(metrics=None, params=None, tags=None)[source]

Run data (metrics and parameters).

classmethod from_proto(proto)[source]
property metrics

Dictionary of string key -> metric value for the current run. For each metric key, the metric value with the latest timestamp is returned. In case there are multiple values with the same latest timestamp, the maximum of these values is returned.

property params

Dictionary of param key (string) -> param value for the current run.

property tags

Dictionary of tag key (string) -> tag value for the current run.

to_dictionary()[source]
to_proto()[source]
class mlflow.entities.RunInfo(run_uuid, experiment_id, user_id, status, start_time, end_time, lifecycle_stage, artifact_uri=None, run_id=None)[source]

Metadata about a run.

property artifact_uri[source]

String root artifact URI of the run.

property end_time[source]

End time of the run, in number of milliseconds since the UNIX epoch.

property experiment_id

String ID of the experiment for the current run.

classmethod from_proto(proto)[source]
classmethod get_orderable_attributes()[source]
classmethod get_searchable_attributes()[source]
property lifecycle_stage
property run_id

String containing run id.

property run_uuid

[Deprecated, use run_id instead] String containing run UUID.

property start_time[source]

Start time of the run, in number of milliseconds since the UNIX epoch.

property status[source]

One of the values in mlflow.entities.RunStatus describing the status of the run.

to_proto()[source]
property user_id

String ID of the user who initiated this run.

class mlflow.entities.RunStatus[source]

Enum for status of an mlflow.entities.Run.

FAILED = 4
FINISHED = 3
KILLED = 5
RUNNING = 1
SCHEDULED = 2
static all_status()[source]
static from_string(status_str)[source]
static is_terminated(status)[source]
static to_string(status)[source]
class mlflow.entities.RunTag(key, value)[source]

Tag object associated with a run.

classmethod from_proto(proto)[source]
property key

String name of the tag.

to_proto()[source]
property value

String value of the tag.

class mlflow.entities.ExperimentTag(key, value)[source]

Tag object associated with an experiment.

classmethod from_proto(proto)[source]
property key

String name of the tag.

to_proto()[source]
property value

String value of the tag.

class mlflow.entities.SourceType[source]

Enum for originating source of a mlflow.entities.Run.

JOB = 2
LOCAL = 4
NOTEBOOK = 1
PROJECT = 3
SOURCETYPE_TO_STRING = {1: 'NOTEBOOK', 2: 'JOB', 3: 'PROJECT', 4: 'LOCAL', 5: 'UNKNOWN'}
UNKNOWN = 5
static from_string(status_str)[source]
static to_string(status)[source]
class mlflow.entities.ViewType[source]

Enum to filter requested experiment types.

ACTIVE_ONLY = 1
ALL = 3
DELETED_ONLY = 2
classmethod from_proto(proto_view_type)[source]
classmethod from_string(view_str)[source]
classmethod to_proto(view_type)[source]
classmethod to_string(view_type)[source]
class mlflow.entities.LifecycleStage[source]
ACTIVE = 'active'
DELETED = 'deleted'
classmethod is_valid(lifecycle_stage)[source]
classmethod matches_view_type(view_type, lifecycle_stage)[source]
classmethod view_type_to_stages(view_type=3)[source]
class mlflow.entities.model_registry.RegisteredModel(name, creation_timestamp=None, last_updated_timestamp=None, description=None, latest_versions=None)[source]

Note

Experimental: This entity may change or be removed in a future release without warning.

MLflow entity for Registered Model.

property creation_timestamp

Integer. Model version creation timestamp (milliseconds since the Unix epoch).

property description

String. Description

classmethod from_proto(proto)[source]
property last_updated_timestamp

Integer. Timestamp of last update for this model version (milliseconds since the Unix epoch).

property latest_versions

List of the latest mlflow.entities.model_registry.ModelVersion instances for each stage

property name

String. Registered model name.

to_proto()[source]
class mlflow.entities.model_registry.ModelVersion(name, version, creation_timestamp, last_updated_timestamp=None, description=None, user_id=None, current_stage=None, source=None, run_id=None, status=None, status_message=None)[source]

Note

Experimental: This entity may change or be removed in a future release without warning.

MLflow entity for Model Version.

property creation_timestamp

Integer. Model version creation timestamp (milliseconds since the Unix epoch).

property current_stage

String. Current stage of this model version.

property description

String. Description

classmethod from_proto(proto)[source]
property last_updated_timestamp

Integer. Timestamp of last update for this model version (milliseconds since the Unix epoch).

property name

String. Unique name within Model Registry.

property run_id

String. MLflow run ID that generated this model.

property source

String. Source path for the model.

property status

String. Current Model Registry status for this model.

property status_message

String. Descriptive message for error status conditions.

to_proto()[source]
property user_id

String. User ID that created this model version.

property version