Skip to content

Fixup naive_bayes #735

@pprett

Description

@pprett

The naive_bayes needs some love!

  1. The current implementation of BaseDiscreteNB requires that the inputs are positive because otherwise the log computation in line 275 will fail. If BaseDiscreteNB is only applicable to non-negative inputs we should enforce that.
  2. GaussianNB what if the variance of a feature is zero? I did a quick fix and add a small constant epsilon (=1e-9).
  3. GaussianNB and BaseDiscreteNB should provide similar functionality. E.g. GaussianNB lacks a fit parameter class_prior and class_weight.
  4. GaussianNB has a performance regression on bench_covtype - error rate used to be 0.23 now 0.46 - this needs to be investigated.
  5. GaussianNB has poor test time performance - should be similar to SGDClassifier (use fortran-style for model parameters).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions