8000 DOC updates for d2_log_loss_score (#28969) · scikit-learn/scikit-learn@1fa3c75 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fa3c75

Browse files
authored
DOC updates for d2_log_loss_score (#28969)
1 parent fa37777 commit 1fa3c75

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sklearn/metrics/_classification.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3277,10 +3277,10 @@ def d2_log_loss_score(y_true, y_pred, *, sample_weight=None, labels=None):
32773277
:math:`D^2` score function, fraction of log loss explained.
32783278
32793279
Best possible score is 1.0 and it can be negative (because the model can be
3280-
arbitrarily worse). A model that always uses the empirical mean of `y_true` as
3281-
constant prediction, disregarding the input features, gets a D^2 score of 0.0.
3280+
arbitrarily worse). A model that always predicts the per-class proportions
3281+
of `y_true`, disregarding the input features, gets a D^2 score of 0.0.
32823282
3283-
Read more in the :ref:`User Guide <d2_score>`.
3283+
Read more in the :ref:`User Guide <d2_score_classification>`.
32843284
32853285
.. versionadded:: 1.5
32863286

sklearn/metrics/tests/test_classification.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3048,7 +3048,8 @@ def test_d2_log_loss_score():
30483048

30493049

30503050
def test_d2_log_loss_score_raises():
3051-
"""Test that d2_log_loss raises error on invalid input."""
3051+
"""Test that d2_log_loss_score raises the appropriate errors on
3052+
invalid inputs."""
30523053
y_true = [0, 1, 2]
30533054
y_pred = [[0.2, 0.8], [0.5, 0.5], [0.4, 0.6]]
30543055
err = "contain different number of classes"

0 commit comments

Comments
 (0)
0