Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 03c4e49

Browse filesBrowse files
alfaro96glemaitre
authored andcommitted
DOC use math mode in r2_score function (#19921)
1 parent 84ca5a5 commit 03c4e49
Copy full SHA for 03c4e49

File tree

1 file changed

+5
-5
lines changed
Filter options

1 file changed

+5
-5
lines changed

‎sklearn/metrics/_regression.py

Copy file name to clipboardExpand all lines: sklearn/metrics/_regression.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,12 @@ def explained_variance_score(y_true, y_pred, *,
587587
@_deprecate_positional_args
588588
def r2_score(y_true, y_pred, *, sample_weight=None,
589589
multioutput="uniform_average"):
590-
"""R^2 (coefficient of determination) regression score function.
590+
""":math:`R^2` (coefficient of determination) regression score function.
591591
592592
Best possible score is 1.0 and it can be negative (because the
593593
model can be arbitrarily worse). A constant model that always
594594
predicts the expected value of y, disregarding the input features,
595-
would get a R^2 score of 0.0.
595+
would get a :math:`R^2` score of 0.0.
596596
597597
Read more in the :ref:`User Guide <r2_score>`.
598598
@@ -630,15 +630,15 @@ def r2_score(y_true, y_pred, *, sample_weight=None,
630630
Returns
631631
-------
632632
z : float or ndarray of floats
633-
The R^2 score or ndarray of scores if 'multioutput' is
633+
The :math:`R^2` score or ndarray of scores if 'multioutput' is
634634
'raw_values'.
635635
636636
Notes
637637
-----
638638
This is not a symmetric function.
639639
640-
Unlike most other scores, R^2 score may be negative (it need not actually
641-
be the square of a quantity R).
640+
Unlike most other scores, :math:`R^2` score may be negative (it need not
641+
actually be the square of a quantity R).
642642
643643
This metric is not well-defined for single samples and will return a NaN
644644
value if n_samples is less than two.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.