8000 DOC mention handlng of empty bins in calibration_curve docstring (#12… · scikit-learn/scikit-learn@f3b2579 · GitHub
[go: up one dir, main page]

Skip to content

Commit f3b2579

Browse files
kms15jnothman
authored andcommitted
DOC mention handlng of empty bins in calibration_curve docstring (#12926)
1 parent 0cf8a16 commit f3b2579

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sklearn/calibration.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,16 @@ def calibration_curve(y_true, y_prob, normalize=False, n_bins=5):
543543
onto 0 and the largest one onto 1.
544544
545545
n_bins : int
546-
Number of bins. A bigger number requires more data.
546+
Number of bins. A bigger number requires more data. Bins with no data
547+
points (i.e. without corresponding values in y_prob) will not be
548+
returned, thus there may be fewer than n_bins in the return value.
547549
548550
Returns
549551
-------
550-
prob_true : array, shape (n_bins,)
552+
prob_true : array, shape (n_bins,) or smaller
551553
The true probability in each bin (fraction of positives).
552554
553-
prob_pred : array, shape (n_bins,)
555+
prob_pred : array, shape (n_bins,) or smaller
554556
The mean predicted probability in each bin.
555557
556558
References

0 commit comments

Comments
 (0)
0