-
Notifications
You must be signed in to change notification settings - Fork 29
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
Plots: View tooltip with table of metric values across selected experiments #4532
Comments
@daavoo @dberenbaum the on hover vertical line was dropped from @aschuh-hf you should be able to achieve this by using a custom template. In order to achieve this add the template to your project and specify the custom template in your custom template
dvc.yaml entry
plotScreen.Recording.2023-08-21.at.11.22.13.am.mov |
Now that flexibility of customizing the plots is pretty neat! I'll give it a try. |
Related repo and an issue in the Vega repo vega/vega-tooltip#215. Overall we could try to utilize the |
AFAICT from the PR, it was an attempt to copy tensorboard's ability to show multiple values per point, but it looks like it came at the expense of showing multiple points at once. From a quick look I'm not sure how easy it is to do both simultaneously even in plotly. |
Sure, I can work with the template @mattseddon provided for now (and anyway often still use TensorBoard in parallel). I also find Vega (or Lite), despite how powerful it may be quite difficult to get used to. So far I stayed away from it. I found https://vega.github.io/vega-lite/examples/interactive_multi_line_pivot_tooltip.html to be closest to what I would like, though I wasn't able to figure out how to have the
Indeed, I was wondering if that was possible. Maybe it's not the highest priority to have that ability, though I did find it quite useful to have the last available metric for any curve prior to the selected timepoint listed alongside others. One might interrupt training runs because its clear they won't perform as expected, especially in case of a hyper-parameter search (e.g., using Ray Tune). Or during live training runs compare the current metric with later times of other curves. |
@aschuh-hf added to the same task list / requirements iterative/dvc-render#7 |
WDYT about the tooltip shown here: Screen.Recording.2023-09-07.at.3.33.40.pm.mov |
This looks great! |
Also note that with the template above, when I click on a plot to show the detail and test the new zoom and pan (which wasn't working for me with the previous template yet using v1.0.52 of the DVC extension), no plot is shown, just an empty canvas. Certainly because there's something off with my attempt to adjust the template. |
I'm sorry, the linked template was not designed to be reused or adapted. I was looking for feedback on the appearance/contents of the tooltip. Seeing as you are only using Custom template{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": "<DVC_METRIC_DATA>"
},
"title": "<DVC_METRIC_TITLE>",
"width": "container",
"height": "container",
"params": [
{
"name": "smooth",
"value": 0.001,
"bind": {
"input": "range",
"min": 0.001,
"max": 1,
"<DVC_METRIC_X>": 0.001
}
}
],
"layer": [
{
"encoding": {
"y": {
"field": "<DVC_METRIC_Y>",
"type": "quantitative",
"title": "<DVC_METRIC_Y_LABEL>",
"scale": {
"zero": false
}
},
"color": {
"field": "rev",
"type": "nominal"
}
},
"layer": [
{ "mark": "line" },
{
"transform": [{ "filter": { "param": "hover", "empty": false } }],
"mark": "point"
}
],
"transform": [
{
"loess": "<DVC_METRIC_Y>",
"on": "<DVC_METRIC_X>",
"groupby": ["rev", "filename", "field", "filename::field"],
"bandwidth": {
"signal": "smooth"
}
}
]
},
{
"params": [{ "bind": "scales", "name": "grid", "select": "interval" }],
"mark": {
"type": "line",
"opacity": 0.2
},
"encoding": {
"x": {
"field": "<DVC_METRIC_X>",
"type": "quantitative",
"title": "<DVC_METRIC_X_LABEL>"
},
"y": {
"field": "<DVC_METRIC_Y>",
"type": "quantitative",
"title": "<DVC_METRIC_Y_LABEL>",
"scale": {
"zero": false
}
},
"color": {
"field": "rev",
"type": "nominal"
}
}
},
{
"mark": {
"type": "circle",
"size": 10,
"tooltip": {
"content": "encoding"
}
},
"encoding": {
"x": {
"aggregate": "max",
"field": "<DVC_METRIC_X>",
"type": "quantitative",
"title": "<DVC_METRIC_X_LABEL>"
},
"y": {
"aggregate": {
"argmax": "step"
},
"field": "<DVC_METRIC_Y>",
"type": "quantitative",
"title": "<DVC_METRIC_Y_LABEL>",
"scale": {
"zero": false
}
},
"color": {
"field": "rev",
"type": "nominal"
}
}
},
{
"transform": [
{
"pivot": "rev",
"value": "acc",
"groupby": ["<DVC_METRIC_X>"]
}
],
"mark": { "type": "rule", "tooltip": { "content": "data" } },
"encoding": {
"opacity": {
"condition": { "value": 0.3, "param": "hover", "empty": false },
"value": 0
}
},
"params": [
{
"name": "hover",
"select": {
"type": "point",
"fields": ["<DVC_METRIC_X>"],
"nearest": true,
"on": "mouseover",
"clear": "mouseout"
}
}
]
}
],
"encoding": {
"x": {
"field": "<DVC_METRIC_X>",
"type": "quantitative",
"title": "<DVC_METRIC_X_LABEL>"
}
}
}
☝🏻 the above template should have zoom on scroll and the previously shown tooltips. Something similar should be the default template soon.
The only way to force DVC to use the updated template is to select the |
Thanks, @mattseddon. I just got around to update to this new template and all is working fine! Loving it. |
Just FYI, I had to update one occurrence of
|
When hovering over a metric plot, I can see tooltips of the metric value for the curve under the cursor (though this takes some patience to get the cursor in the right place also due to lack of zoom, cf. #4530). What I often use and find quite useful with TensorBoard is that this would show me the metric values of all curves either at this or the latest available step (x coordinate). This is quite useful to compare the curves at different timepoints. Would be great if this was also supported by the DVC Plots towards replacing my use of TensorBoard.
Example screenshot from TensorBoard:
The text was updated successfully, but these errors were encountered: