8000 Improve docstring of `_safe_logprob` · scikit-learn/scikit-learn@4fdc5d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4fdc5d7

Browse files
committed
Improve docstring of _safe_logprob
1 parent 0200f8c commit 4fdc5d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/naive_bayes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ def _safe_logprob(p):
4141
4242
Parameters
4343
----------
44-
p : numpy.array
44+
p : array-like or scalar
4545
Probabilities values. Must be within [0, 1] range.
4646
4747
This avoids summation errors, e.g. np.log(0) - np.log(0) = nan, which
4848
may happen while calculating dot product of log probability matrices for
4949
joint likelihood estimation
5050
51-
Note a too large `th` will cause overflow during dot product, which will
52-
also result in wrong estimation of join likelihood
51+
Note that `th` too large will cause overflow during dot product and wrongly
52+
estimate the joint likelihood
5353
"""
5454
th = 1e30
5555
p = np.asarray(p)

0 commit comments

Comments
 (0)
0