Skip to content

feat: expose metric information in MetricResult#326

Merged
sdiazlor merged 3 commits intomainfrom
feat/expose-metric-information-metricresult
Sep 17, 2025
Merged

feat: expose metric information in MetricResult#326
sdiazlor merged 3 commits intomainfrom
feat/expose-metric-information-metricresult

Conversation

@sdiazlor
Copy link
Copy Markdown
Collaborator

@sdiazlor sdiazlor commented Sep 1, 2025

Description

  • Expose metric_units and high_is_better as attributes.
  • Add pos init for compatibility with from_results_dict.
  • Add metrics_units to the string representation to improve the readability.
  • Update notebooks to simplify the evaluation comparison tables and improve the readability.

Related Issue

Fixes #184

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@sdiazlor sdiazlor changed the title feat: expose metric information metricresult feat: expose metric information in MetricResult Sep 1, 2025
" diff = ((base_result - smashed_result) / base_result) * 100\n",
" row = f\"| {base.name} | {base_result:.4f} {base.metric_units or ''}\"\n",
" row += f\"| {smashed_result:.4f} {smashed.metric_units or ''} | {diff:.2f}% |\"\n",
" rows.append(row)\n",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Comparison Table Formatting and Calculation Errors

The make_comparison_table function has two issues. The generated markdown table is malformed due to missing spaces before pipe separators, particularly after metric units. Additionally, the 'Improvement %' calculation might be incorrect when a metric's higher_is_better attribute is None, as it defaults to the 'lower is better' logic.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member

@johannaSommer johannaSommer left a comment

Choose a reason for hiding this comment

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

Love it!!! LGTM, thanks a lot Sara 🫶🏻

Copy link
Copy Markdown
Member

@begumcig begumcig left a comment

Choose a reason for hiding this comment

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

Amazing Thanks!!!

@sdiazlor sdiazlor merged commit b1cb8a9 into main Sep 17, 2025
8 of 9 checks passed
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.

[FEATURE] expose metric information in the MetricResult

3 participants