Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DOC Add var_ attribute and deprecate sigma_ in GaussianNB #18842

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

Conversation

hongshaoyang
Copy link
Contributor

@hongshaoyang hongshaoyang commented Nov 15, 2020

Reference Issues/PRs

Closes #16760

What does this implement/fix? Explain your changes.

  • sigma means std deviation which is confusing as GaussianNB.sigma_ is currently the variance of each feature per class

  • Rename sigma_ to var_ and deprecate sigma_

Any other comments?

@hongshaoyang hongshaoyang changed the title DOC: Add var_ attribute to GaussianNB and deprecate sigma_ [MRG] DOC: Add var_ attribute to GaussianNB and deprecate sigma_ Nov 16, 2020
Copy link
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.

Please add an entry to the change log at doc/whats_new/v*.rst. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:.

sklearn/naive_bayes.py Show resolved Hide resolved
sklearn/naive_bayes.py Outdated Show resolved Hide resolved
sklearn/tests/test_naive_bayes.py Outdated Show resolved Hide resolved
@glemaitre glemaitre changed the title [MRG] DOC: Add var_ attribute to GaussianNB and deprecate sigma_ DOC Add var_ attribute and deprecate sigma_ in GaussianNB Dec 19, 2020
@hongshaoyang
Copy link
Contributor Author

Which version should the whatsnew be in?

@glemaitre
Copy link
Member

glemaitre commented Dec 21, 2020 via email

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.

0.24 has already been released. Please change 0.24 and 1.1 to 1.0 and 1.2.
Otherwise lgtm.

sklearn/naive_bayes.py Outdated Show resolved Hide resolved
sklearn/naive_bayes.py Outdated Show resolved Hide resolved
sklearn/tests/test_naive_bayes.py Outdated Show resolved Hide resolved
sklearn/tests/test_naive_bayes.py Outdated Show resolved Hide resolved
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 @hongshaoyang. Just 2 minor comments

sklearn/tests/test_naive_bayes.py Outdated Show resolved Hide resolved
doc/whats_new/v1.0.rst Outdated Show resolved Hide resolved
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Copy link
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.

Please add an entry to the change log at doc/whats_new/v*.rst. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:.

sklearn/naive_bayes.py Outdated Show resolved Hide resolved
sklearn/naive_bayes.py Outdated Show resolved Hide resolved
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
@hongshaoyang
Copy link
Contributor Author

@glemaitre Whatsnew has been added. Code changes applied.

@glemaitre glemaitre merged commit dfc5e16 into scikit-learn:master Jan 5, 2021
@glemaitre
Copy link
Member

I just solved the conflict in whats new. Merging. Thanks @hongshaoyang

@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
@hongshaoyang hongshaoyang deleted the 16760-GaussianNB-deprecatesigma branch June 9, 2021 08:36
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.

In sklearn.naive_bayes, GaussianNB model return an attribute called sigma_.
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.