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)

Bases: mlflow.entities._mlflow_object._MLflowObject

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.

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

Bases: mlflow.entities._mlflow_object._MLflowObject

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)

Bases: mlflow.entities._mlflow_object._MLflowObject

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)

Bases: mlflow.entities._mlflow_object._MLflowObject

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)

Bases: mlflow.entities._mlflow_object._MLflowObject

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)

Bases: mlflow.entities._mlflow_object._MLflowObject

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)

Bases: mlflow.entities._mlflow_object._MLflowObject

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

Bases: object

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)

Bases: mlflow.entities._mlflow_object._MLflowObject

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.SourceType

Bases: object

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

Bases: object

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

Bases: object

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)