File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change
10BC0
@@ -273,7 +273,13 @@ class RegressorMixin(object):
273273 """Mixin class for all regression estimators in scikit-learn"""
274274
275275 def score (self , X , y ):
276- """Returns the coefficient of determination of the prediction
276+ """Returns the coefficient of determination R^2 of the prediction.
277+
278+ The coefficient R^2 is defined as (1 - u/v), where u is the
279+ regression sum of squares ((y - y_pred) ** 2).sum() and v is the
280+ residual sum of squares ((y_true - y_true.mean()) ** 2).sum().
281+ Best possible score is 1.0, lower values are worse.
282+
277283
278284 Parameters
279285 ----------
Original file line number Diff line number Diff line change @@ -624,16 +624,20 @@ def r2_score(y_true, y_pred):
624624
625625 Best possible score is 1.0, lower values are worse.
626626
627- Note: not a symmetric function.
628-
629- return the R^2 score
630-
631627 Parameters
632628 ----------
633629 y_true : array-like
634630
635631 y_pred : array-like
636632
633+ Returns
634+ -------
635+ z : float
636+ The R^2 score
637+
638+ Notes
639+ -----
640+ This is not a symmetric function.
637641 """
638642 y_true , y_pred = check_arrays (y_true , y_pred )
639643 numerator = ((y_true - y_pred ) ** 2 ).sum ()
You can’t perform that action at this time.
0 commit comments