Skip to content

[bert_squeeze] - refactor: improve metrics calculation - #88

Merged
JulesBelveze merged 1 commit into
mainfrom
fix/metrics-correctness
Jul 23, 2026
Merged

[bert_squeeze] - refactor: improve metrics calculation#88
JulesBelveze merged 1 commit into
mainfrom
fix/metrics-correctness

Conversation

@JulesBelveze

Copy link
Copy Markdown
Owner

Summary

Fixes swapped precision and recall calculations in the classification scorers.

Weighted metrics now return a single support-weighted value, and the same correction is applied to the FastBERT scorer. Added regression tests against scikit-learn.

Testing

  • pytest -q tests/utils/scorers/test_sequence_classification_scorer.py

…and f1 metrics

 - Adjusted the axis used in confusion matrix calculations to ensure correct metric computation.
 - Introduced a weighted average method for metrics to enhance clarity and maintainability of the code.
 - Added unit tests to validate the correctness of the metric calculations against scikit-learn implementations.
@JulesBelveze
JulesBelveze merged commit 2fdf23c into main Jul 23, 2026
@JulesBelveze
JulesBelveze deleted the fix/metrics-correctness branch July 23, 2026 07:09
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.

1 participant