Skip to content

Feature plot metrics - #1012

Open
dgenak wants to merge 4 commits into
alan-turing-institute:mainfrom
dgenak:feature-plot-metrics
Open

Feature plot metrics#1012
dgenak wants to merge 4 commits into
alan-turing-institute:mainfrom
dgenak:feature-plot-metrics

Conversation

@dgenak

@dgenak dgenak commented May 28, 2026

Copy link
Copy Markdown

Enhanced plot_xy metrics visualization

  • Changed r2_score to flexible metrics dictionary
  • Added interactive metrics display above plot
  • Updated tests for new metrics functionality

@dgenak

dgenak commented May 30, 2026

Copy link
Copy Markdown
Author

"Hi! This is our solution for issue #927 - 'Update plot to display any evaluation metric'.
We updated plot_xy in autoemulate/core/plotting.py to accept a metrics dictionary (dict[str, float] | None) instead of a single r2_score. We also added a helper function _add_metrics_box that renders the metrics as clickable boxes above the plot — clicking a box toggles between the metric name and its value.
On the testing side, we updated the existing test_plot_xy and added test_plot_xy_without_metrics to cover the case where no metrics are passed. All tests pass."

@radka-j
radka-j self-requested a review June 3, 2026 10:33
@radka-j

radka-j commented Jun 3, 2026

Copy link
Copy Markdown
Member

Hi @dgenak! Thank you for opening this PR, we really appreciate it. I will try to review this as soon as possible. In the meantime, could you please address the pre-commit issues? If you are unfamiliar with pre-commit, we have instructions in our docs. Please also feel free to ask for help here :)

@dgenak

dgenak commented Jun 3, 2026

Copy link
Copy Markdown
Author

Hi! We ran pre-commit and ruff passed successfully. The only failure was pyright, which is reporting an error in autoemulate/calibration/base.py (lines 143 and 177), a file we didn't modify as part of this PR, so it seems to be a pre-existing issue. Let us know if you'd like us to fix it anyway!

@radka-j

radka-j commented Jun 5, 2026

Copy link
Copy Markdown
Member

Hi @dgenak! If you look at the output of the pre-commit run in the CI here there are issues raised in the new plotting functionality and also in compare because of the changes made here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants