New Features
Live.log_plot
Create DVC plots from datapoints (list of dictionaries) and plot config.
py
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`
json
[
{
"foo": 1,
"bar": 2
},
{
"foo": 3,
"bar": 4
}
]
- `dvclive/dvc.yaml`
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`
<img width="956" alt="Captura de pantalla 2023-04-26 a las 20 16 51" src="https://user-images.githubusercontent.com/12677733/234666832-322cb625-1cdc-4df8-9be1-bf15c7c9470b.png">
Custom plot properties for `Live.log_sklearn_plot`
py
from dvclive import Live
y_true = [0, 0, 1, 1]