Skip to content

Fix internal kwargs leakage in scorers (metrics._scorer) #31293

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

NEREUScode
Copy link
Contributor

I believe this could resolve the problem described in #31288. By filtering out internal control parameters like needs_sample_weight before passing arguments to user-defined scoring functions, this change prevents unexpected TypeErrors while preserving backward compatibility. The implementation maintains the intended functionality of sample weight handling without exposing internal implementation details to end users. 🛠️

Copy link

github-actions bot commented May 1, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 4bb8f21. Link to the linter CI: here

@NEREUScode
Copy link
Contributor Author

@lucyleeow, can you please review this PR? I believe it resolves the issue

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

Successfully merging this pull request may close these issues.

1 participant