class_docstr: Regressor that makes predictions using simple rules.
  
  This regressor is useful as a simple baseline to compare with other
  (real) regressors. Do not use it for real problems.
  
  Read more in the :ref:`User Guide <dummy_estimators>`.
  
  .. versionadded:: 0.13
  
  Parameters
  ----------
  strategy : {"mean", "median", "quantile", "constant"}, default="mean"
      Strategy to use to generate predictions.
  
      * "mean": always predicts the mean of the training set
      * "median": always predicts the median of the training set
      * "quantile": always predicts a specified quantile of the training set,
        provided with the quantile parameter.
      * "constant": always predicts a constant value that is provided by
        the user.
  
  constant : int or float or array-like of shape (n_outputs,), default=None
      The explicit constant as predicted by the "constant" strategy. This
      parameter is useful only for the "constant" strategy.
  
  quantile : float in [0.0, 1.0], default=None
      The quantile to predict using the "quantile" strategy. A quantile of
      0.5 corresponds to the median, while 0.0 to the minimum and 1.0 to the
      maximum.
  
  Attributes
  ----------
  constant_ : ndarray of shape (1, n_outputs)
      Mean or median or quantile of the training targets or constant value
      given by the user.
  
  n_outputs_ : int
      Number of outputs.
  
  See Also
  --------
  DummyClassifier: Classifier that makes predictions using simple rules.
  
  Examples
  --------
  >>> import numpy as np
  >>> from sklearn.dummy import DummyRegressor
  >>> X = np.array([1.0, 2.0, 3.0, 4.0])
  >>> y = np.array([2.0, 3.0, 5.0, 10.0])
  >>> dummy_regr = DummyRegressor(strategy="mean")
  >>> dummy_regr.fit(X, y)
  DummyRegressor()
  >>> dummy_regr.predict(X)
  array([5., 5., 5., 5.])
  >>> dummy_regr.score(X, y)
  0.0
class_docstr_tok: ["Regressor","that","makes","predictions","using","simple","rules",".","This","regressor","is","useful","as","a","simple","baseline","to","compare","with","other","(","real",")","regressors",".","Do","not","use","it","for","real","problems",".","Read","more","in","the",":","ref",":","`","User","Guide","<","dummy_estimators",">","`",".","..","versionadded",":",":","0.13","Parameters","--","--","--","--","--","strategy",":","{","``","mean","''",",","``","median","''",",","``","quantile","''",",","``","constant","''","}",",","default=","''","mean","''","Strategy","to","use","to","generate","predictions",".","*","``","mean","''",":","always","predicts","the","mean","of","the","training","set","*","``","median","''",":","always","predicts","the","median","of","the","training","set","*","``","quantile","''",":","always","predicts","a","specified","quantile","of","the","training","set",",","provided","with","the","quantile","parameter",".","*","``","constant","''",":","always","predicts","a","constant","value","that","is","provided","by","the","user",".","constant",":","int","or","float","or","array-like","of","shape","(","n_outputs",",",")",",","default=None","The","explicit","constant","as","predicted","by","the","``","constant","''","strategy",".","This","parameter","is","useful","only","for","the","``","constant","''","strategy",".","quantile",":","float","in","[","0.0",",","1.0","]",",","default=None","The","quantile","to","predict","using","the","``","quantile","''","strategy",".","A","quantile","of","0.5","corresponds","to","the","median",",","while","0.0","to","the","minimum","and","1.0","to","the","maximum",".","Attributes","--","--","--","--","--","constant_",":","ndarray","of","shape","(","1",",","n_outputs",")","Mean","or","median","or","quantile","of","the","training","targets","or","constant","value","given","by","the","user",".","n_outputs_",":","int","Number","of","outputs",".","See","Also","--","--","--","--","DummyClassifier",":","Classifier","that","makes","predictions","using","simple","rules",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.dummy","import","DummyRegressor",">",">",">","X","=","np.array","(","[","1.0",",","2.0",",","3.0",",","4.0","]",")",">",">",">","y","=","np.array","(","[","2.0",",","3.0",",","5.0",",","10.0","]",")",">",">",">","dummy_regr","=","DummyRegressor","(","strategy=","''","mean","''",")",">",">",">","dummy_regr.fit","(","X",",","y",")","DummyRegressor","(",")",">",">",">","dummy_regr.predict","(","X",")","array","(","[","5.",",","5.",",","5.",",","5",".","]",")",">",">",">","dummy_regr.score","(","X",",","y",")","0.0"]
docstr: Return the coefficient of determination R^2 of the prediction.
  
  The coefficient R^2 is defined as `(1 - u/v)`, where `u` is the
  residual sum of squares `((y_true - y_pred) ** 2).sum()` and `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 R^2 score of
  0.0.
  
  Parameters
  ----------
  X : None or array-like of shape (n_samples, n_features)
      Test samples. Passing None as test samples gives the same result
      as passing real test samples, since `DummyRegressor`
      operates independently of the sampled observations.
  
  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 : float
      R^2 of `self.predict(X)` w.r.t. y.
docstr_tok: ["Return","the","coefficient","of","determination","R^2","of","the","prediction",".","The","coefficient","R^2","is","defined","as","`","(","1","-","u\/v",")","`",",","where","`","u","`","is","the","residual","sum","of","squares","`","(","(","y_true","-","y_pred",")","*","*","2",")",".sum","(",")","`","and","`","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","R^2","score","of","0.0",".","Parameters","--","--","--","--","--","X",":","None","or","array-like","of","shape","(","n_samples",",","n_features",")","Test","samples",".","Passing","None","as","test","samples","gives","the","same","result","as","passing","real","test","samples",",","since","`","DummyRegressor","`","operates","independently","of","the","sampled","observations",".","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",":","float","R^2","of","`","self.predict","(","X",")","`","w.r.t",".","y","."]
code: def score(self, X, y, sample_weight=None):
      """Return the coefficient of determination R^2 of the prediction.
  
      The coefficient R^2 is defined as `(1 - u/v)`, where `u` is the
      residual sum of squares `((y_true - y_pred) ** 2).sum()` and `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 R^2 score of
      0.0.
  
      Parameters
      ----------
      X : None or array-like of shape (n_samples, n_features)
          Test samples. Passing None as test samples gives the same result
          as passing real test samples, since `DummyRegressor`
          operates independently of the sampled observations.
  
      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 : float
          R^2 of `self.predict(X)` w.r.t. y.
      """
      if X is None:
          X = np.zeros(shape=(len(y), 1))
      return super().score(X, y, sample_weight)
  
imports: import warnings
  from numbers import Integral, Real
  import numpy
  import scipy.sparse
  from .base import BaseEstimator, ClassifierMixin, MultiOutputMixin, RegressorMixin, _fit_context
  from .utils import check_random_state
  from .utils._param_validation import Interval, StrOptions
  from .utils.multiclass import class_distribution
  from .utils.random import _random_choice_csc
  from .utils.stats import _weighted_percentile
  from .utils.validation import _check_sample_weight, _num_samples, check_array, check_consistent_length, check_is_fitted
label_desc: Use image node_id 5 for calling the DummyRegressor obj's underlying member method code with example usage: obj.score(X, y, sample_weight) and returns: super