Skip to content

MAINT validate parameter in GaussianNB#23583

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

MAINT validate parameter in GaussianNB#23583
jeremiedbb merged 10 commits intoscikit-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.

Copy link
Copy Markdown
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.

Thanks for the PR @Jitensid. Here are some suggestions

@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
Copy link
Copy Markdown
Member

@glemaitre glemaitre 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
Copy Markdown
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. 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