2.8.0: Live.log_plot
New Features
Live.log_plot
Create DVC plots from datapoints (list of dictionaries) and plot config.
datapoints = [{"foo": 1, "bar": 2}, {"foo": 3, "bar": 4}]
with Live() as live:
live.log_plot("foo_default", datapoints, x="foo", y="bar", title="Default Linear Plot")
live.log_plot(
"foo_scatter",
datapoints,
x="foo",
y="bar",
template="scatter",
title="Plot using Scatter template",
y_label="CUSTOM LABEL: BAR",
x_label="CUSTOM LABEL: FOO"
)
Example output:
dvclive/plots/custom/foo_default.json
[
{
"foo": 1,
"bar": 2
},
{
"foo": 3,
"bar": 4
}
]
dvclive/dvc.yaml
plots:
- plots/custom/foo_default.json:
x: foo
y: bar
title: Default Linear Plot
- plots/custom/foo_scatter.json:
template: scatter
x: foo
y: bar
title: Plot using Scatter template
x_label: 'CUSTOM LABEL: FOO'
y_label: 'CUSTOM LABEL: BAR'
dvc plots show
Custom plot properties for Live.log_sklearn_plot
from dvclive import Live
y_true = [0, 0, 1, 1]
y_score = [0.1, 0.4, 0.35, 0.8]
with Live() as live:
live.log_sklearn_plot(
"roc", y_true, y_score,
# These properties are new
title="Custom Title for ROC Curve",
x_label="False Positive Rate",
y_label="True Positive Rate")
What's Changed
- only log from dvclive by @dberenbaum in #541
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #544
- setup: Use ranges for test dependencies. by @daavoo in #545
- live: Add
log_plot
. by @daavoo in #543
Full Changelog: https://github.com/iterative/dvclive/compare/2.7.0...2.8.0###