Skip to content

DOC Clarifies comments and docstrings in _BaseDiscreteNB #22565

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 9 commits into from
Feb 24, 2022

Conversation

avm19
Copy link
Contributor

@avm19 avm19 commented Feb 21, 2022

Reference Issues/PRs

As far as I know, there was no issue for that. I briefly mentioned what I had on my mind in #22502, where @glemaitre gave me a general guidance, which I am trying to follow.

What does this implement/fix? Explain your changes.

All changes are private.

  1. Docstring for _BaseNB._joint_log_likelihood is corrected: I included a detail, which is important for implementation of a naive Bayes meta-estimators I am working on now (PR is coming within a day or so). I don't think this docstring appears in the documentation.
  2. Abstract methods _count and _update_feature_log_prob are added to the abstract class _BaseDiscreteNB, along with a minimal description of what these methods should do. I believe this addition will facilitate understanding and maintaining the code. Currently, the abstract methods aren't mentioned anywhere, but are called and their effects are expected by concrete methods of the same class. Abstract methods will be added in a separated PR.
  3. Minor grammar in other commentaries.

Any other comments?

None.

Copy link
Member

@thomasjpfan thomasjpfan 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 @avm19!

@avm19 avm19 requested a review from thomasjpfan February 22, 2022 21:58
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
@thomasjpfan thomasjpfan changed the title Add abstract methods to _BaseDiscreteNB and minor comments correction DOC Clarifies comments and docstrings in _BaseDiscreteNB Feb 23, 2022
Copy link
Member

@thomasjpfan thomasjpfan 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 update! LGTM

@thomasjpfan thomasjpfan added the Quick Review For PRs that are quick to review label Feb 23, 2022
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. Thanks @avm19

@jeremiedbb jeremiedbb merged commit b6bc559 into scikit-learn:main Feb 24, 2022
@avm19 avm19 deleted the naive-bayes-abstract branch February 24, 2022 00:24
@avm19
Copy link
Contributor Author

avm19 commented Feb 24, 2022

@thomasjpfan @jeremiedbb Thank you for reviewing. Please see the next one if you are still in the context: PR #22596

thomasjpfan added a commit to thomasjpfan/scikit-learn that referenced this pull request Mar 1, 2022
…n#22565)

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
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.

3 participants