class_docstr: Mixin class for all regression estimators in scikit-learn.
docstr: Return the coefficient of determination :math:`R^2` of the
  prediction.
  
  The coefficient :math:`R^2` is defined as :math:`(1 - \frac{u}{v})`,
  where :math:`u` is the residual sum of squares ``((y_true - y_pred)
  ** 2).sum()`` and :math:`v` is the total sum of squares ``((y_true -
  y_true.mean()) ** 2).sum()``. The best possible score is 1.0 and it
  can be negative (because the model can be arbitrarily worse). A
  constant model that always predicts the expected value of `y`,
  disregarding the input features, would get a :math:`R^2` score of
  0.0.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      Test samples. For some estimators this may be a precomputed
      kernel matrix or a list of generic objects instead with shape
      ``(n_samples, n_samples_fitted)``, where ``n_samples_fitted``
      is the number of samples used in the fitting for the estimator.
  
  y : array-like of shape (n_samples,) or (n_samples, n_outputs)
      True values for `X`.
  
  sample_weight : array-like of shape (n_samples,), default=None
      Sample weights.
  
  Returns
  -------
  score : Tensor
      :math:`R^2` of ``self.predict(X)`` wrt. `y`.
  
  Notes
  -----
  The :math:`R^2` score used when calling ``score`` on a regressor uses
  ``multioutput='uniform_average'`` from version 0.23 to keep consistent
  with default value of :func:`~sklearn.metrics.r2_score`.
  This influences the ``score`` method of all the multioutput
  regressors (except for
  :class:`~sklearn.multioutput.MultiOutputRegressor`).
docstr_tok: ["Return","the","coefficient","of","determination",":","math",":","`","R^2","`","of","the","prediction",".","The","coefficient",":","math",":","`","R^2","`","is","defined","as",":","math",":","`","(","1","-","\\frac","{","u","}","{","v","}",")","`",",","where",":","math",":","`","u","`","is","the","residual","sum","of","squares","``","(","(","y_true","-","y_pred",")","*","*","2",")",".sum","(",")","``","and",":","math",":","`","v","`","is","the","total","sum","of","squares","``","(","(","y_true","-","y_true.mean","(",")",")","*","*","2",")",".sum","(",")","``",".","The","best","possible","score","is","1.0","and","it","can","be","negative","(","because","the","model","can","be","arbitrarily","worse",")",".","A","constant","model","that","always","predicts","the","expected","value","of","`","y","`",",","disregarding","the","input","features",",","would","get","a",":","math",":","`","R^2","`","score","of","0.0",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","Test","samples",".","For","some","estimators","this","may","be","a","precomputed","kernel","matrix","or","a","list","of","generic","objects","instead","with","shape","``","(","n_samples",",","n_samples_fitted",")","``",",","where","``","n_samples_fitted","``","is","the","number","of","samples","used","in","the","fitting","for","the","estimator",".","y",":","array-like","of","shape","(","n_samples",",",")","or","(","n_samples",",","n_outputs",")","True","values","for","`","X","`",".","sample_weight",":","array-like","of","shape","(","n_samples",",",")",",","default=None","Sample","weights",".","Returns","--","--","--","-","score",":","Tensor",":","math",":","`","R^2","`","of","``","self.predict","(","X",")","``","wrt",".","`","y","`",".","Notes","--","--","-","The",":","math",":","`","R^2","`","score","used","when","calling","``","score","``","on","a","regressor","uses","``","multioutput='uniform_average","'","``","from","version","0.23","to","keep","consistent","with","default","value","of",":","func",":","`","~sklearn.metrics.r2_score","`",".","This","influences","the","``","score","``","method","of","all","the","multioutput","regressors","(","except","for",":","class",":","`","~sklearn.multioutput.MultiOutputRegressor","`",")","."]
code: def score(self, X, y, sample_weight=None):
      """Return the coefficient of determination :math:`R^2` of the
      prediction.
  
      The coefficient :math:`R^2` is defined as :math:`(1 - \\frac{u}{v})`,
      where :math:`u` is the residual sum of squares ``((y_true - y_pred)
      ** 2).sum()`` and :math:`v` is the total sum of squares ``((y_true -
      y_true.mean()) ** 2).sum()``. The best possible score is 1.0 and it
      can be negative (because the model can be arbitrarily worse). A
      constant model that always predicts the expected value of `y`,
      disregarding the input features, would get a :math:`R^2` score of
      0.0.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features)
          Test samples. For some estimators this may be a precomputed
          kernel matrix or a list of generic objects instead with shape
          ``(n_samples, n_samples_fitted)``, where ``n_samples_fitted``
          is the number of samples used in the fitting for the estimator.
  
      y : array-like of shape (n_samples,) or (n_samples, n_outputs)
          True values for `X`.
  
      sample_weight : array-like of shape (n_samples,), default=None
          Sample weights.
  
      Returns
      -------
      score : Tensor
          :math:`R^2` of ``self.predict(X)`` wrt. `y`.
  
      Notes
      -----
      The :math:`R^2` score used when calling ``score`` on a regressor uses
      ``multioutput='uniform_average'`` from version 0.23 to keep consistent
      with default value of :func:`~sklearn.metrics.r2_score`.
      This influences the ``score`` method of all the multioutput
      regressors (except for
      :class:`~sklearn.multioutput.MultiOutputRegressor`).
      """
  
      from .metrics import r2_score
  
      y_pred = self.predict(X)
      return r2_score(y, y_pred, sample_weight=sample_weight)
  
file_path: mars/mars/learn/base.py
imports: from sklearn.base import BaseEstimator
  from .utils.validation import check_array, check_X_y
label_desc: Use image node_id 1 for calling the RegressorMixin obj's underlying member method code with example usage: obj.score(X, y, sample_weight) and returns: r2_score