-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Fixup naive_bayes #735
Copy link
Copy link
Open
Description
The naive_bayes needs some love!
The current implementation ofBaseDiscreteNBrequires that the inputs are positive because otherwise the log computation in line 275 will fail. IfBaseDiscreteNBis only applicable to non-negative inputs we should enforce that.GaussianNBwhat if the variance of a feature is zero? I did a quick fix and add a small constant epsilon (=1e-9).GaussianNBandBaseDiscreteNBshould provide similar functionality. E.g.GaussianNBlacks a fit parameterclass_priorandclass_weight.GaussianNBhas a performance regression onbench_covtype- error rate used to be 0.23 now 0.46 - this needs to be investigated.GaussianNBhas poor test time performance - should be similar toSGDClassifier(use fortran-style for model parameters).
Reactions are currently unavailable