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.

MlflowHandle

A handle that proxies the upstream mlflow module while adding session context.

session

Create a strict, context-managed MLflow session.

session_from_file

Create an MLflow session using a shared project config file (TOML or YAML).

session_from_toml

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:

  1. Project root discovery via marker files/directories (e.g., pyproject.toml or .git).

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

DEFAULT_PROJECT_MARKERS

Built-in immutable sequence.

find_project_root

Find a project root directory deterministically.

load_project_config

Load project MLflow config from TOML or YAML based on file extension.

load_project_config_toml

Load project MLflow config from a TOML file.

dump_project_config_yaml

Write a ProjectConfig to a YAML file.

config#

_config.

User guide. See the MLflow Workflow Automation section for further details.

ServerConfig

Configuration that maps directly to mlflow server CLI flags.

SessionConfig

Session-level configuration for scikitplot.mlflow.session.

ProjectConfig

Project-level configuration for MLflow usage across multiple scripts.

errors#

MlflowIntegrationError

Base exception for scikitplot.mlflow errors.

MlflowNotInstalledError

Raised when MLflow is required but not installed.

MlflowCliIncompatibleError

Raised when a requested mlflow server option is not supported by the installed MLflow.

MlflowServerStartError

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.

workflow

Run the built-in end-to-end MLflow workflow demo.

builtin_config_path

Return the path to the built-in demo config shipped with the package.

export_builtin_config

Export the built-in demo config into the current project.

default_project_paths

Compute standard config file paths for a project.