-
-
Notifications
You must be signed in to change notification settings - Fork 26k
MNT use check_scalar to validate scalar in AffinityPropagation #20723
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good.
sklearn/utils/validation.py
Outdated
target_type, | ||
*, | ||
min_val=None, | ||
strictly_greater_min_val=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it not make sense to have a {min, max}_is_inclusive
parameter instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the following cosmetic changes in the error message:
- backticks are too verbose;
- since we show the comparison operators in the error message, let's use
==
instead of=
to display the observed value.
Co-authored-by: Olivier Grisel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM
…t-learn#20723) * MNT use check_scalar to validate scalar in AffinityPropagation * refactor * Apply suggestions from code review Co-authored-by: Olivier Grisel <[email protected]> * iter * iter * iter * iter * iter Co-authored-by: Olivier Grisel <[email protected]>
xref: #20724
Example for using
check_scalar
in parameters validation in estimator class.