I am implementing the Naive Bayes method with Gaussian distribution.
The problem that I have is that the variance used on the Gaussian curve (calculated from a training set) is REALLY small. They are on the order of e-07. That means the whole equation,
(1/:math.sqrt(2*:math.pi*:math.sqrt(variance))) * :math.exp(-0.5*(:math.pow(elem - mean, 2) / variance))
results in really high values (such as
500, or even more). That becomes a problem later, when I multiply every probability p(x|C) together (it is a vector of 256 features).
I heard that is possible to use logarithms to avoid these kind of numbers. I searched on google but didn't find anything related to the subject. Does anyone know about that?