Skip to content
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

exp show: Add parallel coordinates plot. #6933

Merged
merged 4 commits into from
Dec 17, 2021
Merged

exp show: Add parallel coordinates plot. #6933

merged 4 commits into from
Dec 17, 2021

Conversation

daavoo
Copy link
Contributor

@daavoo daavoo commented Nov 5, 2021

Closes #4455

Introduces the following new arguments / behavior to dvc exp show:

  • --html 🀷
  • --sort-by {foo} Defines the column to create colorscale from (Uses Experiment as default)
  • --out {foo}
  • --open

Examples

Using https://github.com/iterative/demo-fashion-mnist

  • Interactivity
Grabacion.de.pantalla.2021-11-30.a.las.13.28.45.mp4
  • Default: dvc exp show -T --html

newplot

  • Customize color: dvc exp show -T --html --sort-by accuracy

newplot(1)

  • Interaction with other options: dvc exp show -T --html -sort-by accuracy --exclude-metrics loss

newplot(2)

@daavoo daavoo self-assigned this Nov 5, 2021
@daavoo daavoo added diff/show Related to the diff/show feature A: experiments Related to dvc exp feature is a feature labels Nov 5, 2021
@daavoo daavoo force-pushed the parallel-coordinates branch 2 times, most recently from 974ef89 to ffbb688 Compare November 12, 2021 16:03
@daavoo daavoo force-pushed the parallel-coordinates branch 2 times, most recently from 6560267 to 823a6f7 Compare November 15, 2021 20:24
@daavoo daavoo changed the title dvc exp: Add parallel coordinates plot exp show: Add parallel coordinates plot. Nov 15, 2021
@daavoo daavoo force-pushed the parallel-coordinates branch 4 times, most recently from 6c86682 to d8c77da Compare November 16, 2021 13:17
@daavoo daavoo marked this pull request as ready for review November 16, 2021 16:35
@daavoo daavoo requested a review from a team as a code owner November 16, 2021 16:35
dvc/command/experiments.py Outdated Show resolved Hide resolved
dvc/command/experiments.py Outdated Show resolved Hide resolved
dvc/command/experiments.py Outdated Show resolved Hide resolved
@dberenbaum
Copy link
Collaborator

My biggest question is whether this belongs in dvc exp show or might be better as a separate command, like dvc exp plot? A dvc exp plot command could also potentially show other things, like dvc plots diff between experiments, or checkpoint trends (like dvclive plots).

Copy link
Collaborator

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

One other comment: behavior seems kind of odd where a value is missing, like the points show up in unpredictable patterns. Would it make sense to have a set value for missing data so it all gets grouped together? Not sure if this is possible for numeric fields.

dvc/command/experiments.py Outdated Show resolved Hide resolved
dvc/command/experiments.py Outdated Show resolved Hide resolved
dvc/command/experiments.py Outdated Show resolved Hide resolved
dvc/command/experiments.py Outdated Show resolved Hide resolved
@daavoo

This comment has been minimized.

@dberenbaum

This comment has been minimized.

@dberenbaum

This comment has been minimized.

@daavoo

This comment has been minimized.

@dberenbaum

This comment has been minimized.

dvc/command/experiments.py Outdated Show resolved Hide resolved
@daavoo daavoo force-pushed the parallel-coordinates branch 2 times, most recently from cc45fc3 to 140c719 Compare December 1, 2021 16:16
@casperdcl
Copy link
Contributor

just to check - the colourbar missing a label in the video/images :)

@daavoo
Copy link
Contributor Author

daavoo commented Dec 2, 2021

just to check - the colourbar missing a label in the video/images :)

Fixed and pushed. Nothing like a good Q/A demo in All Hands

newplot(14)

New renderer based on plotly. Not exposed to `dvc plots`.
Generate plotly datapoints from `TabularData`.

pre-requisite #4455
Uses `ParallelCoordinatesRenderer` and `dvc.render.html.write`.

pre-requisite #4455
Uses `TabularData.to_parallel_coordinates`.
Adds new arguments: `html`, `out`, `open`

Reuses `--sort-by` to define colorscale.

Closes #4455
Adds new argument `fill_value` to ParallelCoordinatesRenderer.

For scalar columns, prevent converting to categorical by explictly inserting None when value is missing (value == fill_value).

For categorical columns, replace `fill_value` with `"Missing"` and ensure it is the last item so it gets rendered on top of the column.
@jorgeorpinel
Copy link
Contributor

--html 🀷

Why something as generic and conceptually disconnected as "HTML"? How about --parallel-coordinates-plot/--pcp? Or a separate command as @dberenbaum mentioned

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Dec 16, 2021

--out {foo}

I understand the default here is dvc_plots/ but dvc plots (show) uses . by default. Seems inconsistent?

@daavoo
Copy link
Contributor Author

daavoo commented Dec 16, 2021

It is the same for plots. At least in current version, DVC pots are saved in dvc_plots

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Dec 16, 2021

According to https://dvc.org/doc/command-reference/plots/show#options dvc plots show uses the same path as the source image or data series file.

It would be more consistent to just use the cwd . I think, as we may be in a subdirectory or something. dvc_plots/ seems to assume we're in the root of the repo.

Or are the docs outdated?

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Dec 16, 2021

Also, the choice of dvc_plots/ by default reinforces the argument that this feature should be in dvc plots exp --pcp or maybe dvc exp plots --pcp (exp. if we plan to have more exp-specific plots) IMO. But maybe I'm missing a discussion that already happened (lots of collapsed comments above).

@pmrowla pmrowla merged commit 4d5be46 into main Dec 17, 2021
@pmrowla pmrowla deleted the parallel-coordinates branch December 17, 2021 05:45
@shcheklein
Copy link
Member

To be honest --html for me would mean an HTML table, not plot. I would consider renaming this to be explicit about its meaning. I think --plot is a bit more explicit. But can limit us later if we decide to introduce more types of plots. Probably --pcp is the best unfortunately.

@daavoo
Copy link
Contributor Author

daavoo commented Dec 17, 2021

Or are the docs outdated?

Yes they are iterative/dvc.org#3110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: experiments Related to dvc exp diff/show Related to the diff/show feature feature is a feature
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

experiments: parallel coordinates plot
8 participants