Skip to main content

Description

DVC metrics commands help you track, display, and compare machine learning metrics across different experiments, commits, branches, and tags. Metrics are numerical values that measure model performance (e.g., accuracy, loss, precision).

Subcommands

metrics show

Print metrics with optional formatting.

Arguments

list
Limit command scope to these metrics files. Using -R, directories to search metrics files in can also be given.

Options

flag
Show metrics for all branches.
flag
Show metrics for all tags.
flag
Show metrics for all commits.
flag
Show output in JSON format.
flag
Show tabulated output in the Markdown format (GFM).
flag
If any target is a directory, recursively search and process metrics files.
integer
Round metrics to n digits precision after the decimal point. Rounds to 5 digits by default.

Example Output

Use --json flag when you need to programmatically parse metrics output.

metrics diff

Show changes in metrics between commits in the DVC repository, or between a commit and the workspace.

Arguments

string
default:"HEAD"
Old Git commit to compare (defaults to HEAD).
string
default:"workspace"
New Git commit to compare (defaults to the current workspace).

Options

list
Specific metrics file(s) to compare (even if not found as metrics in dvc.yaml). Using -R, directories to search metrics files in can also be given. Shows all tracked metrics by default.
flag
If any target is a directory, recursively search and process metrics files.
flag
Show unchanged metrics as well.
flag
Show output in JSON format.
flag
Show tabulated output in the Markdown format (GFM).
flag
Don’t show metric path.
integer
Round metrics to n digits precision after the decimal point. Rounds to 5 digits by default.

Example Output

By default, only changed metrics are shown. Use --all to see unchanged metrics.
Metrics diff requires Git commits. Make sure your changes are committed before comparing.

Use Cases

Track Model Performance

Monitor how your model metrics change across experiments and iterations.

Compare Branches

Evaluate metric differences between feature branches and main branch.

A/B Testing

Compare different model architectures or hyperparameter configurations.

CI/CD Integration

Automate metric reporting in continuous integration pipelines with --json output.
  • dvc params - Compare parameters across experiments
  • dvc plots - Visualize metrics as plots
  • dvc exp show - Show metrics for experiments