Home | Trees | Indices | Help |
|
---|
|
Gaussian Naive Bayes Classifier.
GNB is a probabilistic classifier relying on Bayes rule to estimate posterior probabilities of labels given the data. Naive assumption in it is an independence of the features, which allows to combine per-feature likelihoods by a simple product across likelihoods of"independent" features. See http://en.wikipedia.org/wiki/Naive_bayes for more information.
Provided here implementation is "naive" on its own -- various aspects could be improved, but has its own advantages:
- implementation is simple and straightforward
- no data copying while considering samples of specific class
- provides alternative ways to assess prior distribution of the classes in the case of unbalanced sets of samples (see parameter prior)
- makes use of NumPy broadcasting mechanism, so should be relatively efficient
- should work for any dimensionality of samples
GNB is listed both as linear and non-linear classifier, since specifics of separating boundary depends on the data and/or parameters: linear separation is achieved whenever samples are balanced (or prior='uniform') and features have the same variance across different classes (i.e. if common_variance=True to enforce this).
Whenever decisions are made based on log-probabilities (parameter logprob=True, which is the default), then state variable values if enabled would also contain log-probabilities. Also mention that normalization by the evidence (P(data)) is disabled by default since it has no impact per se on classification decision. You might like set parameter normalize to True if you want to access properly scaled probabilities in values state variable.
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
_clf_internals = ['gnb', 'linear', 'non-linear', 'binary', 'mu Describes some specifics about the classifier -- is that it is doing regression for instance.... |
|||
common_variance = Parameter(False, allowedtype= 'bool', doc= "
|
|||
prior = Parameter('laplacian_smoothing', allowedtype= 'basestr
|
|||
logprob = Parameter(True, allowedtype= 'bool', doc= """Operate
|
|||
normalize = Parameter(False, allowedtype= 'bool', doc= """Norm
|
|||
Inherited from Inherited from |
|
|||
means Means of features per class |
|||
variances Variances per class, but "vars" is taken ;) |
|||
ulabels Labels classifier was trained on |
|||
priors Class probabilities |
|
|||
Inherited from |
|
|
dataset (Dataset).
|
|
|
|
_clf_internalsDescribes some specifics about the classifier -- is that it is doing regression for instance....
|
common_variance
|
prior
|
logprob
|
normalize
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Apr 23 23:09:18 2012 | http://epydoc.sourceforge.net |