Skip to content

Commit 46a1250

Browse files
agramfortlarsmans
authored andcommitted
fix_gnb_proba
1 parent dc5d57d commit 46a1250

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/naive_bayes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def _joint_log_likelihood(self, X):
170170
joint_log_likelihood = []
171171
for i in range(np.size(self.classes_)):
172172
jointi = np.log(self.class_prior_[i])
173-
n_ij = - 0.5 * np.sum(np.log(np.pi * self.sigma_[i, :]))
173+
n_ij = - 0.5 * np.sum(np.log(2. * np.pi * self.sigma_[i, :]))
174174
n_ij -= 0.5 * np.sum(((X - self.theta_[i, :]) ** 2) /
175175
(self.sigma_[i, :]), 1)
176176
joint_log_likelihood.append(jointi + n_ij)

0 commit comments

Comments
 (0)