From a7de0a2ac8c0e3d21170f88c336da9887d54082c Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Tue, 29 Oct 2024 19:07:18 +0100 Subject: [PATCH] DOC fix items in docstring of zero_division --- sklearn/metrics/_classification.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sklearn/metrics/_classification.py b/sklearn/metrics/_classification.py index 5b4f0781a35c0..1a1bd4dcc5180 100644 --- a/sklearn/metrics/_classification.py +++ b/sklearn/metrics/_classification.py @@ -1510,6 +1510,7 @@ def fbeta_score( predictions and labels are negative. Notes: + - If set to "warn", this acts like 0, but a warning is also raised. - If set to `np.nan`, such values will be excluded from the average. @@ -1799,11 +1800,13 @@ def precision_recall_fscore_support( zero_division : {"warn", 0.0, 1.0, np.nan}, default="warn" Sets the value to return when there is a zero division: - - recall: when there are no positive labels - - precision: when there are no positive predictions - - f-score: both + + - recall: when there are no positive labels + - precision: when there are no positive predictions + - f-score: both Notes: + - If set to "warn", this acts like 0, but a warning is also raised. - If set to `np.nan`, such values will be excluded from the average. @@ -2228,6 +2231,7 @@ def precision_score( Sets the value to return when there is a zero division. Notes: + - If set to "warn", this acts like 0, but a warning is also raised. - If set to `np.nan`, such values will be excluded from the average. @@ -2407,6 +2411,7 @@ def recall_score( Sets the value to return when there is a zero division. Notes: + - If set to "warn", this acts like 0, but a warning is also raised. - If set to `np.nan`, such values will be excluded from the average.