class_docstr: An AdaBoost regressor.
  
  An AdaBoost [1] regressor is a meta-estimator that begins by fitting a
  regressor on the original dataset and then fits additional copies of the
  regressor on the same dataset but where the weights of instances are
  adjusted according to the error of the current prediction. As such,
  subsequent regressors focus more on difficult cases.
  
  This class implements the algorithm known as AdaBoost.R2 [2].
  
  Read more in the :ref:`User Guide <adaboost>`.
  
  .. versionadded:: 0.14
  
  Parameters
  ----------
  estimator : object, default=None
      The base estimator from which the boosted ensemble is built.
      If ``None``, then the base estimator is
      :class:`~sklearn.tree.DecisionTreeRegressor` initialized with
      `max_depth=3`.
  
      .. versionadded:: 1.2
         `base_estimator` was renamed to `estimator`.
  
  n_estimators : int, default=50
      The maximum number of estimators at which boosting is terminated.
      In case of perfect fit, the learning procedure is stopped early.
      Values must be in the range `[1, inf)`.
  
  learning_rate : float, default=1.0
      Weight applied to each regressor at each boosting iteration. A higher
      learning rate increases the contribution of each regressor. There is
      a trade-off between the `learning_rate` and `n_estimators` parameters.
      Values must be in the range `(0.0, inf)`.
  
  loss : {'linear', 'square', 'exponential'}, default='linear'
      The loss function to use when updating the weights after each
      boosting iteration.
  
  random_state : int, RandomState instance or None, default=None
      Controls the random seed given at each `estimator` at each
      boosting iteration.
      Thus, it is only used when `estimator` exposes a `random_state`.
      In addition, it controls the bootstrap of the weights used to train the
      `estimator` at each boosting iteration.
      Pass an int for reproducible output across multiple function calls.
      See :term:`Glossary <random_state>`.
  
  base_estimator : object, default=None
      The base estimator from which the boosted ensemble is built.
      If ``None``, then the base estimator is
      :class:`~sklearn.tree.DecisionTreeRegressor` initialized with
      `max_depth=3`.
  
      .. deprecated:: 1.2
          `base_estimator` is deprecated and will be removed in 1.4.
          Use `estimator` instead.
  
  Attributes
  ----------
  estimator_ : estimator
      The base estimator from which the ensemble is grown.
  
      .. versionadded:: 1.2
         `base_estimator_` was renamed to `estimator_`.
  
  base_estimator_ : estimator
      The base estimator from which the ensemble is grown.
  
      .. deprecated:: 1.2
          `base_estimator_` is deprecated and will be removed in 1.4.
          Use `estimator_` instead.
  
  estimators_ : list of regressors
      The collection of fitted sub-estimators.
  
  estimator_weights_ : ndarray of floats
      Weights for each estimator in the boosted ensemble.
  
  estimator_errors_ : ndarray of floats
      Regression error for each estimator in the boosted ensemble.
  
  feature_importances_ : ndarray of shape (n_features,)
      The impurity-based feature importances if supported by the
      ``estimator`` (when based on decision trees).
  
      Warning: impurity-based feature importances can be misleading for
      high cardinality features (many unique values). See
      :func:`sklearn.inspection.permutation_importance` as an alternative.
  
  n_features_in_ : int
      Number of features seen during :term:`fit`.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  AdaBoostClassifier : An AdaBoost classifier.
  GradientBoostingRegressor : Gradient Boosting Classification Tree.
  sklearn.tree.DecisionTreeRegressor : A decision tree regressor.
  
  References
  ----------
  .. [1] Y. Freund, R. Schapire, "A Decision-Theoretic Generalization of
         on-Line Learning and an Application to Boosting", 1995.
  
  .. [2] H. Drucker, "Improving Regressors using Boosting Techniques", 1997.
  
  Examples
  --------
  >>> from sklearn.ensemble import AdaBoostRegressor
  >>> from sklearn.datasets import make_regression
  >>> X, y = make_regression(n_features=4, n_informative=2,
  ...                        random_state=0, shuffle=False)
  >>> regr = AdaBoostRegressor(random_state=0, n_estimators=100)
  >>> regr.fit(X, y)
  AdaBoostRegressor(n_estimators=100, random_state=0)
  >>> regr.predict([[0, 0, 0, 0]])
  array([4.7972...])
  >>> regr.score(X, y)
  0.9771...
class_docstr_tok: ["An","AdaBoost","regressor",".","An","AdaBoost","[","1","]","regressor","is","a","meta-estimator","that","begins","by","fitting","a","regressor","on","the","original","dataset","and","then","fits","additional","copies","of","the","regressor","on","the","same","dataset","but","where","the","weights","of","instances","are","adjusted","according","to","the","error","of","the","current","prediction",".","As","such",",","subsequent","regressors","focus","more","on","difficult","cases",".","This","class","implements","the","algorithm","known","as","AdaBoost.R2","[","2","]",".","Read","more","in","the",":","ref",":","`","User","Guide","<","adaboost",">","`",".","..","versionadded",":",":","0.14","Parameters","--","--","--","--","--","estimator",":","object",",","default=None","The","base","estimator","from","which","the","boosted","ensemble","is","built",".","If","``","None","``",",","then","the","base","estimator","is",":","class",":","`","~sklearn.tree.DecisionTreeRegressor","`","initialized","with","`","max_depth=3","`",".","..","versionadded",":",":","1.2","`","base_estimator","`","was","renamed","to","`","estimator","`",".","n_estimators",":","int",",","default=50","The","maximum","number","of","estimators","at","which","boosting","is","terminated",".","In","case","of","perfect","fit",",","the","learning","procedure","is","stopped","early",".","Values","must","be","in","the","range","`","[","1",",","inf",")","`",".","learning_rate",":","float",",","default=1.0","Weight","applied","to","each","regressor","at","each","boosting","iteration",".","A","higher","learning","rate","increases","the","contribution","of","each","regressor",".","There","is","a","trade-off","between","the","`","learning_rate","`","and","`","n_estimators","`","parameters",".","Values","must","be","in","the","range","`","(","0.0",",","inf",")","`",".","loss",":","{","'linear","'",",","'square","'",",","'exponential","'","}",",","default='linear'","The","loss","function","to","use","when","updating","the","weights","after","each","boosting","iteration",".","random_state",":","int",",","RandomState","instance","or","None",",","default=None","Controls","the","random","seed","given","at","each","`","estimator","`","at","each","boosting","iteration",".","Thus",",","it","is","only","used","when","`","estimator","`","exposes","a","`","random_state","`",".","In","addition",",","it","controls","the","bootstrap","of","the","weights","used","to","train","the","`","estimator","`","at","each","boosting","iteration",".","Pass","an","int","for","reproducible","output","across","multiple","function","calls",".","See",":","term",":","`","Glossary","<","random_state",">","`",".","base_estimator",":","object",",","default=None","The","base","estimator","from","which","the","boosted","ensemble","is","built",".","If","``","None","``",",","then","the","base","estimator","is",":","class",":","`","~sklearn.tree.DecisionTreeRegressor","`","initialized","with","`","max_depth=3","`",".","..","deprecated",":",":","1.2","`","base_estimator","`","is","deprecated","and","will","be","removed","in","1.4",".","Use","`","estimator","`","instead",".","Attributes","--","--","--","--","--","estimator_",":","estimator","The","base","estimator","from","which","the","ensemble","is","grown",".","..","versionadded",":",":","1.2","`","base_estimator_","`","was","renamed","to","`","estimator_","`",".","base_estimator_",":","estimator","The","base","estimator","from","which","the","ensemble","is","grown",".","..","deprecated",":",":","1.2","`","base_estimator_","`","is","deprecated","and","will","be","removed","in","1.4",".","Use","`","estimator_","`","instead",".","estimators_",":","list","of","regressors","The","collection","of","fitted","sub-estimators",".","estimator_weights_",":","ndarray","of","floats","Weights","for","each","estimator","in","the","boosted","ensemble",".","estimator_errors_",":","ndarray","of","floats","Regression","error","for","each","estimator","in","the","boosted","ensemble",".","feature_importances_",":","ndarray","of","shape","(","n_features",",",")","The","impurity-based","feature","importances","if","supported","by","the","``","estimator","``","(","when","based","on","decision","trees",")",".","Warning",":","impurity-based","feature","importances","can","be","misleading","for","high","cardinality","features","(","many","unique","values",")",".","See",":","func",":","`","sklearn.inspection.permutation_importance","`","as","an","alternative",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","..","versionadded",":",":","0.24","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","AdaBoostClassifier",":","An","AdaBoost","classifier",".","GradientBoostingRegressor",":","Gradient","Boosting","Classification","Tree",".","sklearn.tree.DecisionTreeRegressor",":","A","decision","tree","regressor",".","References","--","--","--","--","--","..","[","1","]","Y.","Freund",",","R.","Schapire",",","``","A","Decision-Theoretic","Generalization","of","on-Line","Learning","and","an","Application","to","Boosting","''",",","1995",".","..","[","2","]","H.","Drucker",",","``","Improving","Regressors","using","Boosting","Techniques","''",",","1997",".","Examples","--","--","--","--",">",">",">","from","sklearn.ensemble","import","AdaBoostRegressor",">",">",">","from","sklearn.datasets","import","make_regression",">",">",">","X",",","y","=","make_regression","(","n_features=4",",","n_informative=2",",","...","random_state=0",",","shuffle=False",")",">",">",">","regr","=","AdaBoostRegressor","(","random_state=0",",","n_estimators=100",")",">",">",">","regr.fit","(","X",",","y",")","AdaBoostRegressor","(","n_estimators=100",",","random_state=0",")",">",">",">","regr.predict","(","[","[","0",",","0",",","0",",","0","]","]",")","array","(","[","4.7972","...","]",")",">",">",">","regr.score","(","X",",","y",")","0.9771","..."]
docstr: Predict regression value for X.
  
  The predicted regression value of an input sample is computed
  as the weighted median prediction of the regressors in the ensemble.
  
  Parameters
  ----------
  X : {array-like, sparse matrix} of shape (n_samples, n_features)
      The training input samples. Sparse matrix can be CSC, CSR, COO,
      DOK, or LIL. COO, DOK, and LIL are converted to CSR.
  
  Returns
  -------
  y : ndarray of shape (n_samples,)
      The predicted regression values.
docstr_tok: ["Predict","regression","value","for","X",".","The","predicted","regression","value","of","an","input","sample","is","computed","as","the","weighted","median","prediction","of","the","regressors","in","the","ensemble",".","Parameters","--","--","--","--","--","X",":","{","array-like",",","sparse","matrix","}","of","shape","(","n_samples",",","n_features",")","The","training","input","samples",".","Sparse","matrix","can","be","CSC",",","CSR",",","COO",",","DOK",",","or","LIL",".","COO",",","DOK",",","and","LIL","are","converted","to","CSR",".","Returns","--","--","--","-","y",":","ndarray","of","shape","(","n_samples",",",")","The","predicted","regression","values","."]
code: def predict(self, X):
      """Predict regression value for X.
  
      The predicted regression value of an input sample is computed
      as the weighted median prediction of the regressors in the ensemble.
  
      Parameters
      ----------
      X : {array-like, sparse matrix} of shape (n_samples, n_features)
          The training input samples. Sparse matrix can be CSC, CSR, COO,
          DOK, or LIL. COO, DOK, and LIL are converted to CSR.
  
      Returns
      -------
      y : ndarray of shape (n_samples,)
          The predicted regression values.
      """
      check_is_fitted(self)
      X = self._check_X(X)
  
      return self._get_median_predict(X, len(self.estimators_))
  
imports: import warnings
  from abc import ABCMeta, abstractmethod
  from numbers import Integral, Real
  import numpy
  from scipy.special import xlogy
  from ..base import ClassifierMixin, RegressorMixin, _fit_context, is_classifier, is_regressor
  from ..metrics import accuracy_score, r2_score
  from ..tree import DecisionTreeClassifier, DecisionTreeRegressor
  from ..utils import _safe_indexing, check_random_state
  from ..utils._param_validation import HasMethods, Interval, StrOptions
  from ..utils.extmath import softmax, stable_cumsum
  from ..utils.validation import _check_sample_weight, _num_samples, check_is_fitted, has_fit_parameter
  from ._base import BaseEnsemble
label_desc: Use image node_id 5 for calling the AdaBoostRegressor obj's underlying member method code with example usage: obj.predict(X) and returns: self