MlflowChart¶
MlflowChart
¶
MlflowChart(*, tracking_uri: str | None = None, experiment_id: str | None = None, runs: Sequence[Any] | None = None, metric_key: str = '', poll_seconds: int | None = 5, smoothing_kind: str = 'gaussian', smoothing_param: float | None = None, show_slider: bool = True, x_axis: str = 'step', width: int = 700, height: int = 300, **kwargs: Any)
Bases: AnyWidget
Live line chart that polls MLflow for metric data.
Renders a Canvas-based chart that can auto-update while runs are active. Supports multiple runs for side-by-side comparison and optional rolling smoothing (rolling mean, exponential moving average, or gaussian).
Examples:
import mlflow
from mlflow_widgets import MlflowChart
with mlflow.start_run() as run:
for step in range(100):
mlflow.log_metric("loss", 1.0 / (step + 1), step=step)
chart = MlflowChart(
tracking_uri="http://localhost:5000",
runs=[run],
metric_key="loss",
)
chart
Create a MlflowChart widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tracking_uri
|
str | None
|
MLflow tracking server URI. Defaults to
|
None
|
experiment_id
|
str | None
|
MLflow experiment ID. If provided and |
None
|
runs
|
Sequence[Any] | None
|
A list of MLflow Run objects, run-ID strings, or dicts
with |
None
|
metric_key
|
str
|
The metric key to chart (e.g. |
''
|
poll_seconds
|
int | None
|
Seconds between polling updates, or |
5
|
smoothing_kind
|
str
|
|
'gaussian'
|
smoothing_param
|
float | None
|
Smoothing parameter, or |
None
|
show_slider
|
bool
|
Whether to show the smoothing slider in the UI. |
True
|
x_axis
|
str
|
X-axis mode: |
'step'
|
width
|
int
|
Chart width in pixels. |
700
|
height
|
int
|
Chart height in pixels. |
300
|
Source code in src/mlflow_widgets/chart.py
refresh
¶
Manually refresh metric data from MLflow.