Skip to content

MAINT validate parameter in GaussianNB - #23583

Merged
jeremiedbb merged 10 commits into
scikit-learn:mainfrom
Jitensid:gaussianNB_validate_params
Jun 28, 2022
Merged

jeremiedbb merged 10 commits into
scikit-learn:mainfrom
Jitensid:gaussianNB_validate_params

Conversation

@Jitensid

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

GaussianNB uses _validate_parameters as part of #23462

What does this implement/fix? Explain your changes.

  1. GaussianNB has a new class attribute _parameter_constraints that defines the valid types and values for the parameters.
  2. Both fit and partial_fit methods first call the self._validate_params() method.

Any other comments?

If there are any mistakes please let me know and I will fix them as soon as possible.

@jeremiedbb jeremiedbb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR @Jitensid. Here are some suggestions

Comment thread sklearn/naive_bayes.py Resolved
Comment thread sklearn/naive_bayes.py Resolved
Comment thread sklearn/naive_bayes.py Resolved
@Jitensid

Copy link
Copy Markdown
Contributor Author

@jeremiedbb I have made changes as per your suggestion.

@Jitensid
Jitensid requested a review from jeremiedbb June 13, 2022 07:26
@jeremiedbb jeremiedbb added the Validation related to input validation label Jun 13, 2022
@Jitensid Jitensid changed the title [MRG] Gaussian NB uses validate_params [MAINT] Gaussian NB uses validate_params Jun 21, 2022
@Jitensid Jitensid changed the title [MAINT] Gaussian NB uses validate_params [MRG] Gaussian NB uses validate_params Jun 21, 2022
@glemaitre
glemaitre self-requested a review June 27, 2022 07:34
@glemaitre glemaitre changed the title [MRG] Gaussian NB uses validate_params MAINT validate parameter in GaussianNB Jun 27, 2022

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@jeremiedbb jeremiedbb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. thanks @Jitensid

@jeremiedbb
jeremiedbb merged commit a00441f into scikit-learn:main Jun 28, 2022
ogrisel pushed a commit to ogrisel/scikit-learn that referenced this pull request Jul 11, 2022
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.

3 participants