Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 8 commits into from
Aug 31, 2021

Conversation

glemaitre
Copy link
Member

@glemaitre glemaitre commented Aug 10, 2021

xref: #20724

Example for using check_scalar in parameters validation in estimator class.

@glemaitre glemaitre marked this pull request as ready for review August 11, 2021 09:53
Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

overall looks good.

target_type,
*,
min_val=None,
strictly_greater_min_val=False,
Copy link
Member

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?

Copy link
Member

@ogrisel ogrisel left a 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.

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

@adrinjalali adrinjalali merged commit bd077e3 into scikit-learn:main Aug 31, 2021
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
…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]>
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.

5 participants