-
Notifications
You must be signed in to change notification settings - Fork 407
Regular updates & plots 1.0 update #1382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8030c46
5bffb49
431ffc0
3f2d554
86b8f62
b75f314
47ad311
2f1e09c
3a723a0
bc54b22
177de9b
f59eea9
c73f7c0
140608c
0028b53
8e572a5
434fe96
5108e14
fba18c3
a75dda2
30493ab
d33aecc
e385a02
22b648c
f3cba9c
532184b
4d9cd71
791dbd2
697ab77
3eb3858
90cac8e
94027c5
19fbe99
c51e2ad
13dce7c
3a418f6
4729c0d
5a92508
aa620cc
1357d22
74c5234
9e26518
0bfb2ad
ae1d911
da639ef
a467891
f6a2e4f
a613233
ba94d6d
0d5f502
439f8e0
7bce905
edd0323
c0ce897
6bcf06d
b0f49c3
471a565
9169967
de9110a
1bcae8d
2c50676
dc0725c
1970fc3
cd602c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,81 +1,86 @@ | ||
| # plots diff | ||
|
|
||
| Show multiple versions of [plot metrics](/doc/command-reference/plots) by | ||
| plotting them in a single image. | ||
| plotting them in a single image. This allows to easily compare them. | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```usage | ||
| usage: dvc plots diff [-h] [-q | -v] [-t [TEMPLATE]] [-d [DATAFILE]] [-f FILE] | ||
| [-s SELECT] [-x X] [-y Y] [--stdout] [--no-csv-header] | ||
| [--no-html] [--title TITLE] [--xlab XLAB] [--ylab YLAB] | ||
| [revisions [revisions ...]] | ||
| usage: dvc plots diff [-h] [-q | -v] [--targets [<path> [<path> ...]]] | ||
| [-t <name_or_path>] [-x <field>] [-y <field>] | ||
| [--no-header] [--title <text>] | ||
| [--x-label <text>] [--y-label <text>] [-o <path>] | ||
| [--show-vega] | ||
| [revisions [revisions ...]] | ||
|
|
||
| positional arguments: | ||
| revisions Git commits to plot from | ||
| revisions Git commits to find metrics to compare | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| This command visualize difference between metrics among experiments in the | ||
| repository history. Requires that Git is being used to version the metrics | ||
| files. | ||
| This command is a way to visualize the "difference" between metrics among | ||
| experiments in the <abbr>repository</abbr> history, by plotting multiple | ||
| versions of the metrics. All plots defined in `dvc.yaml` are used by default. | ||
|
|
||
| The metrics file needs to be specified through `-d`/`--datafile` option. Also, a | ||
| plot can be customized with | ||
| [plot templates](/doc/command-reference/plots#plot-templates) using the | ||
| `--template` option. To learn more about the file formats and templates please | ||
| see `dvc plots`. | ||
| > Note that unlike `dvc metrics diff`, this command does not calculate numeric | ||
| > differences between metric file values. | ||
|
Comment on lines
+26
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
|
|
||
| `revisions` are Git commit hashes, tag, or branch names. If none are specified, | ||
| `dvc plots diff` compares metrics currently present in the | ||
| <abbr>workspace</abbr> (uncommitted changes) with the latest committed version. | ||
| A single specified revision results in plotting the difference in metrics | ||
| between the workspace and that version. | ||
| `dvc plots diff` compares targets currently present in the | ||
jorgeorpinel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <abbr>workspace</abbr> (uncommitted changes) with their latest committed | ||
| versions (required). A single specified revision results in comparing the | ||
| workspace and that version. | ||
|
|
||
| In contrast to commands such as `git diff`, `dvc metrics diff` and | ||
| `dvc params diff`, **any number of `revisions` can be provided**, and the | ||
| resulting plot shows all of them in a single output. | ||
| Note that any number of `revisions` can be provided, and the resulting plot | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. omit "Note that" ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (it's not a Note at the moment)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a block quote, correct. But it's a note as in: it's a small detail we want to make sure the reader notes. We have another 49 instances of "Note that" in docs that are not in a block quote 😬 |
||
| shows all of them in a single output. | ||
|
|
||
| This command can work with metric files that are committed to a repository | ||
| history, data files controlled by DVC, or any other file in the workspace. In | ||
| the case of DVC-tracked `datafile`, the `revisions` are used to find the | ||
| corresponding [DVC-files](/doc/user-guide/dvc-file-format). | ||
| The plot style can be customized with | ||
| [plot templates](/doc/command-reference/plots#plot-templates), using the | ||
| `--template` option. To learn more about metric file formats and templates | ||
| please see `dvc plots`. | ||
|
|
||
| > Note that the default behavior of this command can be modified per metrics | ||
| > file with `dvc plots modify`. | ||
|
|
||
| ## Options | ||
|
|
||
| - `-d [DATAFILE], --datafile [DATAFILE]` - metrics file to visualize. | ||
| - `--targets <path>` - specific metric files to visualize. These must be listed | ||
| in a [`dvc.yaml`](/doc/user-guide/dvc-file-format) file (see the `--plots` | ||
| option of `dvc run`). | ||
|
|
||
| - `-o <path>, --out <path>` - name of the generated file. By default, the output | ||
| file name is equal to the input filename with a `.html` file extension (or | ||
| `.json` when using `--show-vega`). | ||
|
|
||
| - `-t [TEMPLATE], --template [TEMPLATE]` - | ||
| - `-t <name_or_path>, --template <name_or_path>` - | ||
| [plot template](/doc/command-reference/plots#plot-templates) to be injected | ||
| with data. The default template is `.dvc/plots/default.json`. See more details | ||
| in `dvc plots`. | ||
|
|
||
| - `-f FILE, --file FILE` - name of the generated file. By default, the output | ||
| file name is equal to the input filename with additional `.html` suffix or | ||
| `.json` suffix for `--no-html` mode. | ||
|
|
||
| - `--no-html` - do not wrap output Vega specification (JSON) with HTML. | ||
|
|
||
| - `-x X` - field name for X axis. An auto-generated `index` field is used by | ||
| default. | ||
| - `-x <field>` - field name from which the X axis data comes from. An | ||
| auto-generated `index` field is used by default. See | ||
| [Custom templates](/doc/command-reference/plots#custom-templates) for more | ||
| information on this `index` field. Column names or numbers are expected for | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. number -> indices will it work btw if no-header is not provided?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shcheklein
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I called them column "numbers" because there's also an auto-generated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kk, let's move forward with for now |
||
| tabular metric files. | ||
|
|
||
| - `-y Y` - field name for Y axis. The last column or field found in the | ||
| `datafile` is used by default. | ||
| - `-y <field>` - field name from which the Y axis data comes from. The last | ||
jorgeorpinel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| field found in the `--targets` is used by default. Column names or numbers are | ||
| expected for tabular metric files. | ||
|
|
||
| - `-s SELECT, --select SELECT` - select which fields or JSONPath to store in the | ||
| metrics file [metadata](https://vega.github.io/vega/docs/data/). The | ||
| auto-generated, zero-based `index` column is always included. | ||
| - `--x-label <text>` - X axis label. The X field name is the default. | ||
|
|
||
| - `--xlab XLAB` - X axis title. The X field name is the default title. | ||
| - `--y-label <text>` - Y axis label. The Y field name is the default. | ||
|
|
||
| - `--ylab YLAB` - Y axis title. The Y field name is the default title. | ||
| - `--title <text>` - plot title. | ||
|
|
||
| - `--title TITLE` - plot title. | ||
| - `--show-vega` - produce a | ||
| [Vega specification](https://vega.github.io/vega/docs/specification/) file | ||
| instead of HTML. See `dvc plots` for more info. | ||
|
|
||
| - `-o, --stdout` - print plot content to stdout. | ||
|
|
||
| - `--no-csv-header` - provided CSV or TSV datafile does not have a header. | ||
| - `--no-header` - lets DVC know that CSV or TSV `--targets` do not have a | ||
| header. A 0-based numeric index can be used to identify each column instead of | ||
| names. | ||
|
|
||
| - `-h`, `--help` - prints the usage/help message, and exit. | ||
|
|
||
|
|
@@ -86,21 +91,22 @@ corresponding [DVC-files](/doc/user-guide/dvc-file-format). | |
|
|
||
| ## Examples | ||
|
|
||
| To visualize the difference between uncommitted changes of a metrics file and | ||
| the last commit: | ||
| To compare uncommitted changes of a metrics file and its last committed version: | ||
|
|
||
| ```dvc | ||
| $ dvc plots diff -d logs.csv | ||
| $ dvc plots diff --targets logs.csv --x-label x | ||
| file:///Users/dmitry/src/plots/logs.html | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| The difference between two versions (commit hashes, tags, or branches can be | ||
| provided): | ||
| > Note that we renamed the X axis label with option `--x-label x`. | ||
|
|
||
| Compare two specific versions (commit hashes, tags, or branches can be provided, | ||
| for example): | ||
|
|
||
| ```dvc | ||
| $ dvc plots diff -d logs.csv HEAD 0135527 | ||
| $ dvc plots diff --targets logs.csv HEAD 0135527 | ||
| file:///Users/usr/src/plots/logs.csv.html | ||
| ``` | ||
|
|
||
|
|
@@ -110,7 +116,7 @@ file:///Users/usr/src/plots/logs.csv.html | |
|
|
||
| We'll use tabular metrics file `classes.csv` for this example: | ||
|
|
||
| ```csv | ||
| ``` | ||
| predicted,actual | ||
| cat,cat | ||
| cat,cat | ||
|
|
@@ -124,13 +130,13 @@ cat,turtle | |
| ... | ||
| ``` | ||
|
|
||
| A predefined confusion matrix | ||
| The predefined confusion matrix | ||
| [template](/doc/command-reference/plots#plot-templates) (in | ||
| `.dvc/plots/confusion.json`) shows how metric differences can be faceted by | ||
| separate plots: | ||
| `.dvc/plots/confusion.json`) shows how metric comparisons can be faceted by | ||
| separate plots. It can be enabled with `-t` (`--template`): | ||
|
|
||
| ```dvc | ||
| $ dvc plots diff -t confusion -x predicted -d classes.csv | ||
| $ dvc plots diff -t confusion --targets classes.csv -x predicted | ||
| file:///Users/usr/src/test/plot_old/classes.csv.html | ||
| ``` | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.