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.
Mlflow Session Helper#
_session.
User guide. See the MLflow Workflow Automation section for further details.
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. |
project config helpers#
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. |
|
Find a project root directory deterministically. |
|
Load project MLflow config from TOML or YAML based on file extension. |
|
Load project MLflow config from a TOML file. |
|
Write a ProjectConfig to a YAML file. |
config#
_config.
User guide. See the MLflow Workflow Automation section for further details.
Configuration that maps directly to |
|
Session-level configuration for |
|
Project-level configuration for MLflow usage across multiple scripts. |
errors#
Base exception for scikitplot.mlflow errors. |
|
Raised when MLflow is required but not installed. |
|
Raised when a requested |
|
Raised when the managed MLflow server fails to start or exits prematurely. |
workflow helpers#
_workflow.
User guide. See the MLflow Workflow Automation section for further details.
Run the built-in end-to-end MLflow workflow demo. |
|
Return the path to the built-in demo config shipped with the package. |
|
Export the built-in demo config into the current project. |
|
Compute standard config file paths for a project. |