In `sklearn.naive_bayes`, `GaussianNB` model return an attribute called `sigma_`.
See original GitHub issueIn the document, sigma_
is the variance of each feature per class, but in general, it means standard variation. So we either change its name to variance_
or call sigma_
the std of each feature per class.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
sklearn.naive_bayes.GaussianNB
Returns the log-probability of the samples for each class in the model. The columns correspond to the classes in sorted order, as they...
Read more >Source code for sklearn.naive_bayes - Diffprivlib
return np.exp(self.predict_log_proba(X)) class GaussianNB(_BaseNB): """ Gaussian Naive Bayes (GaussianNB). Can perform online updates to model parameters ...
Read more >AttributeError: 'GaussianNB' object has no attribute 'var_'
The model is being generated with sckikit-learn version 0.24.2 or less and it's being read by a scikit-learn version 1.0.0 or higher.
Read more >8.20.1. sklearn.naive_bayes.GaussianNB - GitHub Pages
class sklearn.naive_bayes.GaussianNB¶. Gaussian Naive Bayes (GaussianNB) ... Returns the log-probability of the sample for each class in the model, ...
Read more >mdp.nodes.GaussianNBScikitsLearnNode
Class GaussianNBScikitsLearnNode. Gaussian Naive Bayes (GaussianNB) This node has been automatically generated by wrapping the ``sklearn.naive_bayes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For example, Sigma can be used to represent the covariance matrix in multivariate normal distributions:
While for the single variable case:
Anyways for this case, I am okay with this being
var_
.On a side note, it is a little strange how the attribute names do not match the variables in the user guide: https://scikit-learn.org/stable/modules/naive_bayes.html#gaussian-naive-bayes
Currently,
theta_
is used for the mean andsigma_
is used for the variance.take