class_docstr: Mixin class for all regression estimators in scikit-learn.
class_docstr_tok: ["Mixin","class","for","all","regression","estimators","in","scikit-learn","."]
docstr: Returns the coefficient of determination R^2 of the prediction.
  
  The coefficient R^2 is defined as (1 - u/v), where u is the regression
  sum of squares ((y_true - y_pred) ** 2).sum() and v is the residual
  sum of squares ((y_true - y_true.mean()) ** 2).sum().
  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 R^2 score of 0.0.
  
  Parameters
  ----------
  X : array-like, shape = (n_samples, n_features)
      Test samples.
  
  y : array-like, shape = (n_samples) or (n_samples, n_outputs)
      True values for X.
  
  sample_weight : array-like, shape = [n_samples], optional
      Sample weights.
  
  Returns
  -------
  score : float
      R^2 of self.predict(X) wrt. y.
docstr_tok: ["Returns","the","coefficient","of","determination","R^2","of","the","prediction",".","The","coefficient","R^2","is","defined","as","(","1","-","u\/v",")",",","where","u","is","the","regression","sum","of","squares","(","(","y_true","-","y_pred",")","*","*","2",")",".sum","(",")","and","v","is","the","residual","sum","of","squares","(","(","y_true","-","y_true.mean","(",")",")","*","*","2",")",".sum","(",")",".","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","R^2","score","of","0.0",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","=","(","n_samples",",","n_features",")","Test","samples",".","y",":","array-like",",","shape","=","(","n_samples",")","or","(","n_samples",",","n_outputs",")","True","values","for","X.","sample_weight",":","array-like",",","shape","=","[","n_samples","]",",","optional","Sample","weights",".","Returns","--","--","--","-","score",":","float","R^2","of","self.predict","(","X",")","wrt",".","y","."]
code: def score(self, X, y, sample_weight=None):
      """Returns the coefficient of determination R^2 of the prediction.
  
      The coefficient R^2 is defined as (1 - u/v), where u is the regression
      sum of squares ((y_true - y_pred) ** 2).sum() and v is the residual
      sum of squares ((y_true - y_true.mean()) ** 2).sum().
      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 R^2 score of 0.0.
  
      Parameters
      ----------
      X : array-like, shape = (n_samples, n_features)
          Test samples.
  
      y : array-like, shape = (n_samples) or (n_samples, n_outputs)
          True values for X.
  
      sample_weight : array-like, shape = [n_samples], optional
          Sample weights.
  
      Returns
      -------
      score : float
          R^2 of self.predict(X) wrt. y.
      """
  
      from .metrics import r2_score
  
      return r2_score(
          y,
          self.predict(X),
          sample_weight=sample_weight,
          multioutput="variance_weighted",
      )
  
imports: import copy
  import warnings
  import numpy
  from scipy import sparse
  from .externals import six
  from .utils.fixes import signature
  from .utils.deprecation import deprecated
  from .exceptions import ChangedBehaviorWarning
  from .None import __version__
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