Traits
- pydantic model mlopus.mlflow.MlflowApiMixin[source]
Bases:
BaseModelMixin for pydantic classes that hold a reference to a Mlflow API instance.
The API is instantiated by the utility mlopus.mlflow.get_api() on object initialization.
Example:
class Foo(MlflowMixinApi): pass foo = Foo( mlflow_api={"plugin": "...", "conf": {...}} # kwargs for `mlopus.mlflow.get_api()` ) foo.mlflow_api # BaseMlflowApi
-
field mlflow_api:
BaseMlflowApi= None Instance of
BaseMlflowApior a dict of keyword arguments formlopus.mlflow.get_api().
-
field mlflow_api:
- pydantic model mlopus.mlflow.MlflowRunMixin[source]
Bases:
BaseModelMixin for pydantic classes that hold a reference to a MlflowRunManager.
-
field run_manager:
Optional[MlflowRunManager] [Required] (alias 'mlflow') Instance or dict to be parsed into instance of
MlflowRunManager
-
field run_manager:
- pydantic model mlopus.mlflow.MlflowRunManager[source]
Bases:
MlflowApiMixinA pydantic object that holds a reference to an ongoing MLflow Run.
If
run.idis given, that run is resumed.Otherwise, an ongoing run is searched for in
exp.namecontainingrun.tagsIf none can be found, a new run is started in
exp.namecontainingrun.tags
Example:
config = { "api": {...}, # kwargs for `mlopus.mlflow.get_api()` "exp": {"name": ...}, "run": {"name": ..., "tags": ..., "id": ...}, } foo_1 = MlflowRunManager(**config) foo_2 = MlflowRunManager(**config) # Objects with same config share the same managed run assert foo_1.run.id == foo_2.run.id # Accessing the cached property `run` triggers the resume/search/creation of the run.
-
field exp:
ExpConf[Optional] Experiment specification (created if doesn’t exist). Used to find or create the run.
-
field mlflow_api:
BaseMlflowApi[Required] (alias 'api') Instance of
BaseMlflowApior a dict of keyword arguments formlopus.mlflow.get_api().
-
field run_conf:
RunConf[Optional] (alias 'run') Run specification, used for resuming, finding or creating the run.