scikitplot.mlflow#
scikitplot.mlflow#
MLflow UI | SERVER share the exact same settings.
Adds a project-level configuration mechanism so multiple scripts
(e.g., train.py, hpo.py, predict.py) share the exact same MLflow settings,
regardless of current working directory.
Examples
Quiskstart Template: Beginner workflow demo
>>> import os
>>> import scikitplot as sp
>>>
>>> # print(sp.mlflow.DEFAULT_PROJECT_MARKERS)
>>> # Walk upward from `start` until a directory containing any marker is found.
>>> # export SCIKITPLOT_PROJECT_MARKERS='[".git","pyproject.toml","README.txt","configs/mlflow.toml"]'
>>> os.environ["SCIKITPLOT_PROJECT_MARKERS"] = (
... '[".git","pyproject.toml","README.txt","configs/mlflow.toml"]'
... )
>>> sp.mlflow.workflow(
... profile="local",
... open_ui_seconds=30,
... experiment_name="my-first-project",
... fmt="toml",
... overwrite=True, # If config already exists: ./configs/mlflow.toml (use overwrite=True).
... )
CLI
>>> # Walk upward from `start` until a directory containing any marker is found.
>>> # export SCIKITPLOT_PROJECT_MARKERS='[".git","pyproject.toml","README.txt","configs/mlflow.toml"]'
>>> python -m scikitplot.mlflow --profile local --open-ui-seconds 5
User guide. See the MLflow Workflow Automation section for further details.
Cli Helper#
frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object |
|
Parsed capability set for |
|
Validate that all long-form CLI flags in |
|
Get supported |
Compat Helper#
Import MLflow lazily with a user-friendly error. |
|
Resolve a canonical artifact download function across MLflow versions. |
Config Helper#
_config.
User guide. See the MLflow Workflow Automation section for further details.
Configuration that maps directly to |
|
Session-level configuration for |
Container Helper#
Detect whether the current process is running in a Docker container. |
Customization Helper#
A customizable provider for MLflow-like libraries. |
|
Retrieve the currently active MLflow provider. |
|
Set the active MLflow provider globally. |
|
Temporarily set the MLflow provider for a context block. |
Env Helper#
Full snapshot of process environment for strict restoration. |
|
Apply |
|
Parse a minimal |
Error Helper#
Raised when a requested |
|
Base exception for scikitplot.mlflow errors. |
|
Raised when MLflow is required but not installed. |
|
Raised when the managed MLflow server fails to start or exits prematurely. |
|
Raised when an operation is rejected by the active |
Facade Helper#
Artifact helper facade bound to a specific MLflow client/URI. |
|
Model helper facade bound to a session-bound MLflow client. |
Project Helper#
Project configuration helpers for mlflow.
This module provides two distinct, deterministic responsibilities:
Project root discovery via marker files/directories (e.g.,
pyproject.tomlor.git).Project-level MLflow config I/O (TOML/YAML) that normalizes local paths so that multiple scripts (train/hpo/predict) behave consistently regardless of current working directory.
Notes
This module intentionally exposes a small public surface for marker customization, while keeping
the underlying mutable default private. Users should prefer:
- get_project_markers
- set_project_markers
- project_markers (context manager)
- Environment override via SCIKITPLOT_PROJECT_MARKERS (strict JSON list of strings)
- Config override via a TOML file containing [project].markers = [...]
Examples
Option A — temporary (best for automation pipelines)
>>> from scikitplot.mlflow._project import project_markers, find_project_root
>>>
>>> with project_markers(["pyproject.toml", ".git", "configs/mlflow.toml"]):
... root = find_project_root()
Option B — environment (best for CI)
>>> import os
>>>
>>> # Default marker file-folder for auto detection
>>> # Walk upward from `start` until a directory containing any marker is found.
>>> # export SCIKITPLOT_PROJECT_MARKERS='[".git","pyproject.toml","README.txt","configs/mlflow.toml"]'
>>> os.environ["SCIKITPLOT_PROJECT_MARKERS"] = (
... '[".git","pyproject.toml","README.txt","configs/mlflow.toml"]'
... )
Option C — config-driven (best for teams)
>>> [project]
>>> markers = ["pyproject.toml", ".git", "configs/mlflow.toml"]
User guide. See the MLflow Workflow Automation section for further details.
Built-in immutable sequence. |
|
Project-level configuration for MLflow usage across multiple scripts. |
|
Write a ProjectConfig to a YAML file. |
|
Ensure local backend/artifact directories exist. |
|
Find a project root directory deterministically. |
|
Resolve project markers deterministically. |
|
Load project MLflow config from TOML or YAML based on file extension. |
|
Load project MLflow config from a TOML file. |
|
Load project MLflow config from a YAML file. |
|
Normalize local store values for consistent multi-script usage. |
|
Temporarily override module default markers for a block. |
|
Set the module default markers. |
Readiness Helper#
Wait until the MLflow tracking REST API responds. |
Security Helper#
Declarative security policy for |
|
Declarative security policy for |
|
Declarative security policy for |
|
Return the currently active |
|
Temporarily activate a |
|
Set the active |
Server Helper#
Spawned MLflow server process state. |
|
Build the CLI args for |
|
Build a deterministic |
|
Spawn an MLflow server subprocess. |
Session Helper#
A handle that proxies the upstream |
|
Create a strict, context-managed MLflow session. |
|
Create an MLflow session using a shared project config file (TOML or YAML). |
|
Create an MLflow session using a shared project TOML config. |
Helper#
Parsed MLflow version. |
|
Check whether MLflow is installed in the current Python environment. |
|
Retrieve the installed MLflow version (if available). |
Workflow Helper#
Standardized project config paths used by the workflow. |
|
Return the path to the built-in demo config shipped with the package. |
|
Compute standard config file paths for a project. |
|
Export the built-in demo config into the current project. |
|
Patch |
|
Run a beginner-friendly end-to-end demo workflow. |
|
Run the built-in end-to-end MLflow workflow demo. |