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 e9d4e93 commit 72b2f9cCopy full SHA for 72b2f9c
Orange/classification/naive_bayes.py
@@ -57,9 +57,10 @@ def predict_storage(self, data):
57
np.log(self.class_prob) +
58
np.array([np.zeros_like(self.class_prob)
59
if isnan(ins.x).all() else
60
- np.sum(attr_prob[:, int(attr_val)]
61
- for attr_val, attr_prob in zip(ins, self.log_cont_prob)
62
- if not isnan(attr_val))
+ np.sum([attr_prob[:, int(attr_val)]
+ for attr_val, attr_prob in
+ zip(ins, self.log_cont_prob)
63
+ if not isnan(attr_val)], axis=0)
64
for ins in data]))
65
probs /= probs.sum(axis=1)[:, None]
66
values = probs.argmax(axis=1)
0 commit comments