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)

Experiment object.

DEFAULT_EXPERIMENT_NAME = 'Default'
artifact_location

String corresponding to the root artifact URI for the experiment.

experiment_id

String ID of the experiment.

classmethod from_proto(proto)
lifecycle_stage

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

name

String name of the experiment.

tags

Tags that have been set on the experiment.

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

Metadata about a file or directory.

file_size

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

classmethod from_proto(proto)
is_dir

Whether the FileInfo corresponds to a directory.

path

String path of the file or directory.

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

Metric object.

classmethod from_proto(proto)
key

String key corresponding to the metric name.

step

Integer metric step (x-coordinate).

timestamp

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

to_proto()
value

Float value of the metric.

class mlflow.entities.Param(key, value)

Parameter object.

classmethod from_proto(proto)
key

String key corresponding to the parameter name.

to_proto()
value

String value of the parameter.

class mlflow.entities.Run(run_info, run_data)

Run object.

data

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

Return type:mlflow.entities.RunData
classmethod from_proto(proto)
info

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

Return type:mlflow.entities.RunInfo
to_dictionary()
to_proto()
class mlflow.entities.RunData(metrics=None, params=None, tags=None)

Run data (metrics and parameters).

classmethod from_proto(proto)
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.

params

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

tags

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

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

Metadata about a run.

artifact_uri

String root artifact URI of the run.

end_time

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

experiment_id

String ID of the experiment for the current run.

classmethod from_proto(proto)
classmethod get_orderable_attributes()
classmethod get_searchable_attributes()
lifecycle_stage
run_id

String containing run id.

run_uuid

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

start_time

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

status

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

to_proto()
user_id

String ID of the user who initiated this run.

class mlflow.entities.RunStatus

Enum for status of an mlflow.entities.Run.

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

Tag object associated with a run.

classmethod from_proto(proto)
key

String name of the tag.

to_proto()
value

String value of the tag.

class mlflow.entities.ExperimentTag(key, value)

Tag object associated with an experiment.

classmethod from_proto(proto)
key

String name of the tag.

to_proto()
value

String value of the tag.

class mlflow.entities.SourceType

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)
static to_string(status)
class mlflow.entities.ViewType

Enum to filter requested experiment types.

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

Note

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

MLflow entity for Registered Model. A registered model entity is uniquely identified by its name.

classmethod from_proto(proto)
name

String. Unique name for this registered model within Model Registry.

to_proto()
class mlflow.entities.model_registry.RegisteredModelDetailed(name, creation_timestamp, last_updated_timestamp=None, description=None, latest_versions=None)

Note

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

MLflow entity for Registered Model Detailed. Provides additional metadata data for registered model in addition to information in mlflow.entities.model_registry.RegisteredModel.

creation_timestamp

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

description

String. Description

classmethod from_proto(proto)
last_updated_timestamp

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

latest_versions

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

to_proto()
class mlflow.entities.model_registry.ModelVersion(registered_model, version)

Note

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

MLflow entity for Model Version. A model version is uniquely identified using underlying mlflow.entities.model_registry.RegisteredModel and version number.

classmethod from_proto(proto)
get_name()

String. Unique name within Model Registry.

registered_model

An instance of mlflow.entities.model_registry.RegisteredModel

to_proto()
version

Integer version number

class mlflow.entities.model_registry.ModelVersionDetailed(registered_model, 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)

Note

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

MLflow entity for Model Version Detailed. Provides additional metadata data for model version in addition to information in mlflow.entities.model_registry.ModelVersion.

creation_timestamp

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

current_stage

String. Current stage of this model version.

description

String. Description

classmethod from_proto(proto)
last_updated_timestamp

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

run_id

String. MLflow run ID that generated this model.

source

String. Source path for the model.

status

String. Current Model Registry status for this model.

status_message

String. Descriptive message for error status conditions.

to_proto()
user_id

String. User ID that created this model version.