We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc5d57d commit 46a1250Copy full SHA for 46a1250
sklearn/naive_bayes.py
@@ -170,7 +170,7 @@ def _joint_log_likelihood(self, X):
170
joint_log_likelihood = []
171
for i in range(np.size(self.classes_)):
172
jointi = np.log(self.class_prior_[i])
173
- n_ij = - 0.5 * np.sum(np.log(np.pi * self.sigma_[i, :]))
+ n_ij = - 0.5 * np.sum(np.log(2. * np.pi * self.sigma_[i, :]))
174
n_ij -= 0.5 * np.sum(((X - self.theta_[i, :]) ** 2) /
175
(self.sigma_[i, :]), 1)
176
joint_log_likelihood.append(jointi + n_ij)
0 commit comments