diff --git a/sklearn/metrics/_classification.py b/sklearn/metrics/_classification.py index a1fb638bb29db..ff591ba0c85c5 100644 --- a/sklearn/metrics/_classification.py +++ b/sklearn/metrics/_classification.py @@ -2545,22 +2545,23 @@ def log_loss( Returns ------- loss : float + Log loss, aka logistic loss or cross-entropy loss. Notes ----- The logarithm used is the natural logarithm (base-e). + References + ---------- + C.M. Bishop (2006). Pattern Recognition and Machine Learning. Springer, + p. 209. + Examples -------- >>> from sklearn.metrics import log_loss >>> log_loss(["spam", "ham", "ham", "spam"], ... [[.1, .9], [.9, .1], [.8, .2], [.35, .65]]) 0.21616... - - References - ---------- - C.M. Bishop (2006). Pattern Recognition and Machine Learning. Springer, - p. 209. """ y_pred = check_array(y_pred, ensure_2d=False) check_consistent_length(y_pred, y_true, sample_weight) diff --git a/sklearn/tests/test_docstrings.py b/sklearn/tests/test_docstrings.py index cc5883f3acc4b..36ffe78ecfb14 100644 --- a/sklearn/tests/test_docstrings.py +++ b/sklearn/tests/test_docstrings.py @@ -35,7 +35,6 @@ "sklearn.metrics._classification.brier_score_loss", "sklearn.metrics._classification.cohen_kappa_score", "sklearn.metrics._classification.jaccard_score", - "sklearn.metrics._classification.log_loss", "sklearn.metrics._plot.det_curve.plot_det_curve", "sklearn.metrics._plot.precision_recall_curve.plot_precision_recall_curve", "sklearn.metrics._ranking.coverage_error",