8000
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.
_safe_logprob
1 parent 0200f8c commit 4fdc5d7Copy full SHA for 4fdc5d7
sklearn/naive_bayes.py
@@ -41,15 +41,15 @@ def _safe_logprob(p):
41
42
Parameters
43
----------
44
- p : numpy.array
+ p : array-like or scalar
45
Probabilities values. Must be within [0, 1] range.
46
47
This avoids summation errors, e.g. np.log(0) - np.log(0) = nan, which
48
may happen while calculating dot product of log probability matrices for
49
joint likelihood estimation
50
51
- Note a too large `th` will cause overflow during dot product, which will
52
- also result in wrong estimation of join likelihood
+ Note that `th` too large will cause overflow during dot product and wrongly
+ estimate the joint likelihood
53
"""
54
th = 1e30
55
p = np.asarray(p)
0 commit comments