From 7b25c1e4bfdc99a75c7ab5f7488e1e0f615130d9 Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Tue, 15 Aug 2017 13:57:15 -0500 Subject: [PATCH 1/4] Updates the roc_auc_score and average_precision_score docstrings Changes the description of the y_true parameter to be slightly more explicit about the allowed values. --- sklearn/metrics/ranking.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sklearn/metrics/ranking.py b/sklearn/metrics/ranking.py index 2003ed8b314c8..b23f1a46c9789 100644 --- a/sklearn/metrics/ranking.py +++ b/sklearn/metrics/ranking.py @@ -116,7 +116,8 @@ def average_precision_score(y_true, y_score, average="macro", Parameters ---------- y_true : array, shape = [n_samples] or [n_samples, n_classes] - True binary labels in binary label indicators. + True binary labels (either {0, 1} or {-1, 1}) or binary label + indicators. y_score : array, shape = [n_samples] or [n_samples, n_classes] Target scores, can either be probability estimates of the positive @@ -200,7 +201,8 @@ def roc_auc_score(y_true, y_score, average="macro", sample_weight=None): Parameters ---------- y_true : array, shape = [n_samples] or [n_samples, n_classes] - True binary labels in binary label indicators. + True binary labels (either {0, 1} or {-1, 1}) or binary label + indicators. y_score : array, shape = [n_samples] or [n_samples, n_classes] Target scores, can either be probability estimates of the positive From abe8903dc3025af020ad3a0f6dc2ba4629b8c414 Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Tue, 15 Aug 2017 15:43:54 -0500 Subject: [PATCH 2/4] Updates y_true description in roc_curve docstring --- sklearn/metrics/ranking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/metrics/ranking.py b/sklearn/metrics/ranking.py index b23f1a46c9789..fb0c18fc6a069 100644 --- a/sklearn/metrics/ranking.py +++ b/sklearn/metrics/ranking.py @@ -440,7 +440,7 @@ def roc_curve(y_true, y_score, pos_label=None, sample_weight=None, ---------- y_true : array, shape = [n_samples] - True binary labels in range {0, 1} or {-1, 1}. If labels are not + True binary labels (either {0, 1} or {-1, 1}). If labels are not binary, pos_label should be explicitly given. y_score : array, shape = [n_samples] From 9011776f0d34f0a6ac6d974cef0ebd04fafecdd0 Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Wed, 16 Aug 2017 18:48:45 -0500 Subject: [PATCH 3/4] Rewords y_true description in roc_curve docstring --- sklearn/metrics/ranking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/metrics/ranking.py b/sklearn/metrics/ranking.py index fb0c18fc6a069..dfebb0e06b442 100644 --- a/sklearn/metrics/ranking.py +++ b/sklearn/metrics/ranking.py @@ -440,8 +440,8 @@ def roc_curve(y_true, y_score, pos_label=None, sample_weight=None, ---------- y_true : array, shape = [n_samples] - True binary labels (either {0, 1} or {-1, 1}). If labels are not - binary, pos_label should be explicitly given. + True binary labels. If labels are not either {-1, 1} or {0, 1}, then + pos_label should be explicitly given. y_score : array, shape = [n_samples] Target scores, can either be probability estimates of the positive From 98c7bace704e957b85c462901e17dfc1d95a8810 Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Mon, 21 Aug 2017 15:50:13 -0500 Subject: [PATCH 4/4] Updates roc_auc_score and average_precision_score docstrings --- sklearn/metrics/ranking.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sklearn/metrics/ranking.py b/sklearn/metrics/ranking.py index dfebb0e06b442..fde1f1c441125 100644 --- a/sklearn/metrics/ranking.py +++ b/sklearn/metrics/ranking.py @@ -116,8 +116,7 @@ def average_precision_score(y_true, y_score, average="macro", Parameters ---------- y_true : array, shape = [n_samples] or [n_samples, n_classes] - True binary labels (either {0, 1} or {-1, 1}) or binary label - indicators. + True binary labels (either {0, 1} or {-1, 1}). y_score : array, shape = [n_samples] or [n_samples, n_classes] Target scores, can either be probability estimates of the positive @@ -201,8 +200,7 @@ def roc_auc_score(y_true, y_score, average="macro", sample_weight=None): Parameters ---------- y_true : array, shape = [n_samples] or [n_samples, n_classes] - True binary labels (either {0, 1} or {-1, 1}) or binary label - indicators. + True binary labels (either {0, 1} or {-1, 1}). y_score : array, shape = [n_samples] or [n_samples, n_classes] Target scores, can either be probability estimates of the positive