Skip to content

MAINT Parameters validation for metrics.recall_score #25816

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

Merged
merged 1 commit into from Mar 13, 2023
Merged

MAINT Parameters validation for metrics.recall_score #25816

merged 1 commit into from Mar 13, 2023

Conversation

ghost
Copy link

@ghost ghost commented Mar 10, 2023

Reference Issues/PRs

Towards #24862

What does this implement/fix? Explain your changes.

This PR implements parameter validation for metrics.recall_score

Any other comments?

I followed the same pattern as metrics.precision_score, however I wonder if implementing parameter validation for functions deriving from metrics.precision_recall_fscore_support is/was really necessary:

  • metrics.f1_score
  • metrics.fbeta_score
  • metrics.precision_score
  • metrics.recall_score

Indeed these function all eventually call metrics.precision_recall_fscore_support, whose parameters are validated. Isn't it redundant to validate parameters for these functions as well?

@jeremiedbb
Copy link
Member

Indeed these function all eventually call metrics.precision_recall_fscore_support, whose parameters are validated. Isn't it redundant to validate parameters for these functions as well?

It is and can be the source of significant slowdowns for some function. This is why I opened #25815 to be able to avoid these nested validations.

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM

@jeremiedbb jeremiedbb merged commit 0538e42 into scikit-learn:main Mar 13, 2023
@ghost
Copy link
Author

ghost commented Mar 13, 2023

Indeed these function all eventually call metrics.precision_recall_fscore_support, whose parameters are validated. Isn't it redundant to validate parameters for these functions as well?

It is and can be the source of significant slowdowns for some function. This is why I opened #25815 to be able to avoid these nested validations.

Thanks for your answer, I will have a look at #25815.

@ghost ghost deleted the validate_params_recall_score branch March 13, 2023 18:55
Veghit pushed a commit to Veghit/scikit-learn that referenced this pull request Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant