Skip to content

fix(evaluator): forward METRIC_KWARGS during bootstrap confidence intervals - #890

Open
fanjiahe wants to merge 1 commit into
huggingface:mainfrom
fanjiahe:fix/evaluator-bootstrap-metric-kwargs
Open

fanjiahe wants to merge 1 commit into
huggingface:mainfrom
fanjiahe:fix/evaluator-bootstrap-metric-kwargs

Conversation

@fanjiahe

Copy link
Copy Markdown

Fixes #858

Summary

  • Updated Evaluator._compute_confidence_interval() and Evaluator.compute_metric() in src/evaluate/evaluator/base.py to accept and forward metric_kwargs=self.METRIC_KWARGS when computing bootstrap confidence intervals and standard errors.
  • Handled sample_weight (when present and non-None in metric_kwargs) as a paired input alongside metric_inputs so scipy.stats.bootstrap resamples weights in lockstep with predictions/references while keeping fixed options (e.g.
    ormalize=False, �verage=macro) constant without mutating self.METRIC_KWARGS.
  • Kept metric_kwargs optional (None default) so direct callers of Evaluator._compute_confidence_interval(...) remain backwards-compatible.
  • Added unit tests in ests/test_evaluator_bootstrap.py covering fixed kwargs (�ccuracy with
    ormalize=False, multiclass 1 with �verage=macro), paired sample_weight resampling against a direct scipy.stats.bootstrap reference, and backwards-compatible invocation.

Verification

  • pytest tests/test_evaluator_bootstrap.py -v — 4 passed.

AI-assisted contribution (human-reviewed and verified locally).

Copilot AI balanced review requested due to automatic review settings November 27, 2026 06:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

Base evaluator bootstrap drops fixed metric options

2 participants