optimize naive bayes classifier caching the log-likelihood denominator

Hi, this is just a very simple optimization to make testing of naive bayes classifier much faster.