Description
Compare the metrics and parameters between two experiments or revisions. This command provides a focused comparison showing what changed between two specific runs, making it easy to understand the impact of parameter changes on model performance.Usage
Arguments
string
default:"HEAD"
Old experiment or Git revision to compare. Defaults to HEAD if not specified.Can be:
- Experiment name (e.g.,
exp-a1b2c) - Git commit SHA
- Git branch name
- Git tag
string
default:"workspace"
New experiment or Git revision to compare. Defaults to the current workspace.
Options
boolean
default:"false"
Show unchanged metrics and parameters as well. By default, only changed values are displayed.
boolean
default:"false"
Show only parameters that are stage dependencies (defined in
dvc.yaml).boolean
default:"false"
Show output in JSON format for programmatic processing.
boolean
default:"false"
Show output in Markdown table format (GitHub Flavored Markdown).
boolean
default:"false"
Don’t show the metric/parameter file path in output.
integer
default:"5"
Round metrics to N digits after the decimal point.
Examples
Compare workspace with HEAD
Positive diff values indicate improvement in metrics (when higher is better).
Compare two specific experiments
Show all metrics including unchanged
Unchanged values have a diff of 0 or show the same value in both columns.
Hide file paths
Export to JSON
JSON format is perfect for integrating with CI/CD pipelines or custom analysis scripts.
Format as Markdown table
Compare with custom precision
Compare branches
Understanding the Output
Metrics Table
The metrics table shows:- Path: File containing the metric (e.g.,
metrics.json) - Metric: Metric name within the file
- Old value: Metric value in first revision
- New value: Metric value in second revision
- Diff: Numerical difference (new - old)
Parameters Table
The parameters table shows:- Path: File containing the parameter (e.g.,
params.yaml) - Param: Parameter name within the file
- Old value: Parameter value in first revision
- New value: Parameter value in second revision
Parameters don’t show a diff because they’re often non-numeric values.
Common Workflows
Quick experiment validation
A/B testing
CI/CD integration
Documentation generation
Related Commands
dvc exp show- View all experiments in a tabledvc exp run- Create new experiments to comparedvc metrics diff- Compare metrics without experiment contextdvc params diff- Compare parameters without experiment context