Skip to content

Commit

Permalink
DOC Ensures that balanced_accuracy_score passes numpydoc validation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
embandera authored Nov 7, 2021
1 parent 48e83df commit bcdbf7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"sklearn.linear_model._ridge.ridge_regression",
"sklearn.manifold._locally_linear.locally_linear_embedding",
"sklearn.manifold._t_sne.trustworthiness",
"sklearn.metrics._classification.balanced_accuracy_score",
"sklearn.metrics._classification.brier_score_loss",
"sklearn.metrics._classification.classification_report",
"sklearn.metrics._classification.cohen_kappa_score",
Expand Down
9 changes: 7 additions & 2 deletions sklearn/metrics/_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -1943,10 +1943,16 @@ def balanced_accuracy_score(y_true, y_pred, *, sample_weight=None, adjusted=Fals
Returns
-------
balanced_accuracy : float
Balanced accuracy score.
See Also
--------
recall_score, roc_auc_score
average_precision_score : Compute average precision (AP) from prediction
scores.
precision_score : Compute the precision score.
recall_score : Compute the recall score.
roc_auc_score : Compute Area Under the Receiver Operating Characteristic
Curve (ROC AUC) from prediction scores.
Notes
-----
Expand All @@ -1973,7 +1979,6 @@ def balanced_accuracy_score(y_true, y_pred, *, sample_weight=None, adjusted=Fals
>>> y_pred = [0, 1, 0, 0, 0, 1]
>>> balanced_accuracy_score(y_true, y_pred)
0.625
"""
C = confusion_matrix(y_true, y_pred, sample_weight=sample_weight)
with np.errstate(divide="ignore", invalid="ignore"):
Expand Down

0 comments on commit bcdbf7d

Please sign in to comment.