class_docstr: Gradient boosting with component-wise least squares as base learner.
  
  See the :ref:`User Guide </user_guide/boosting.ipynb>` and [1]_ for further description.
  
  Parameters
  ----------
  loss : {'coxph', 'squared', 'ipcwls'}, optional, default: 'coxph'
      loss function to be optimized. 'coxph' refers to partial likelihood loss
      of Cox's proportional hazards model. The loss 'squared' minimizes a
      squared regression loss that ignores predictions beyond the time of censoring,
      and 'ipcwls' refers to inverse-probability of censoring weighted least squares error.
  
  learning_rate : float, optional, default: 0.1
      learning rate shrinks the contribution of each base learner by `learning_rate`.
      There is a trade-off between `learning_rate` and `n_estimators`.
      Values must be in the range `[0.0, inf)`.
  
  n_estimators : int, default: 100
      The number of boosting stages to perform. Gradient boosting
      is fairly robust to over-fitting so a large number usually
      results in better performance.
      Values must be in the range `[1, inf)`.
  
  subsample : float, optional, default: 1.0
      The fraction of samples to be used for fitting the individual base
      learners. If smaller than 1.0 this results in Stochastic Gradient
      Boosting. `subsample` interacts with the parameter `n_estimators`.
      Choosing `subsample < 1.0` leads to a reduction of variance
      and an increase in bias.
      Values must be in the range `(0.0, 1.0]`.
  
  dropout_rate : float, optional, default: 0.0
      If larger than zero, the residuals at each iteration are only computed
      from a random subset of base learners. The value corresponds to the
      percentage of base learners that are dropped. In each iteration,
      at least one base learner is dropped. This is an alternative regularization
      to shrinkage, i.e., setting `learning_rate < 1.0`.
      Values must be in the range `[0.0, 1.0)`.
  
  random_state : int seed, RandomState instance, or None, default: None
      The seed of the pseudo random number generator to use when
      shuffling the data.
  
  verbose : int, default: 0
      Enable verbose output. If 1 then it prints progress and performance
      once in a while.
      Values must be in the range `[0, inf)`.
  
  Attributes
  ----------
  coef_ : array, shape = (n_features + 1,)
      The aggregated coefficients. The first element `coef\_[0]` corresponds
      to the intercept. If loss is `coxph`, the intercept will always be zero.
  
  estimators_ : list of base learners
      The collection of fitted sub-estimators.
  
  train_score_ : array, shape = (n_estimators,)
      The i-th score ``train_score_[i]`` is the deviance (= loss) of the
      model at iteration ``i`` on the in-bag sample.
      If ``subsample == 1`` this is the deviance on the training data.
  
  oob_improvement_ : array, shape = (n_estimators,)
      The improvement in loss (= deviance) on the out-of-bag samples
      relative to the previous iteration.
      ``oob_improvement_[0]`` is the improvement in
      loss of the first stage over the ``init`` estimator.
  
  n_features_in_ : int
      Number of features seen during ``fit``.
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during ``fit``. Defined only when `X`
      has feature names that are all strings.
  
  unique_times_ : array of shape = (n_unique_times,)
      Unique time points.
  
  References
  ----------
  .. [1] Hothorn, T., Bühlmann, P., Dudoit, S., Molinaro, A., van der Laan, M. J.,
         "Survival ensembles", Biostatistics, 7(3), 355-73, 2006
class_docstr_tok: ["Gradient","boosting","with","component-wise","least","squares","as","base","learner",".","See","the",":","ref",":","`","User","Guide","<","\/user_guide\/boosting.ipynb",">","`","and","[","1","]","_","for","further","description",".","Parameters","--","--","--","--","--","loss",":","{","'coxph","'",",","'squared","'",",","'ipcwls","'","}",",","optional",",","default",":","'coxph'","loss","function","to","be","optimized",".","'coxph","'","refers","to","partial","likelihood","loss","of","Cox","'s","proportional","hazards","model",".","The","loss","'squared","'","minimizes","a","squared","regression","loss","that","ignores","predictions","beyond","the","time","of","censoring",",","and","'ipcwls","'","refers","to","inverse-probability","of","censoring","weighted","least","squares","error",".","learning_rate",":","float",",","optional",",","default",":","0.1","learning","rate","shrinks","the","contribution","of","each","base","learner","by","`","learning_rate","`",".","There","is","a","trade-off","between","`","learning_rate","`","and","`","n_estimators","`",".","Values","must","be","in","the","range","`","[","0.0",",","inf",")","`",".","n_estimators",":","int",",","default",":","100","The","number","of","boosting","stages","to","perform",".","Gradient","boosting","is","fairly","robust","to","over-fitting","so","a","large","number","usually","results","in","better","performance",".","Values","must","be","in","the","range","`","[","1",",","inf",")","`",".","subsample",":","float",",","optional",",","default",":","1.0","The","fraction","of","samples","to","be","used","for","fitting","the","individual","base","learners",".","If","smaller","than","1.0","this","results","in","Stochastic","Gradient","Boosting",".","`","subsample","`","interacts","with","the","parameter","`","n_estimators","`",".","Choosing","`","subsample","<","1.0","`","leads","to","a","reduction","of","variance","and","an","increase","in","bias",".","Values","must","be","in","the","range","`","(","0.0",",","1.0","]","`",".","dropout_rate",":","float",",","optional",",","default",":","0.0","If","larger","than","zero",",","the","residuals","at","each","iteration","are","only","computed","from","a","random","subset","of","base","learners",".","The","value","corresponds","to","the","percentage","of","base","learners","that","are","dropped",".","In","each","iteration",",","at","least","one","base","learner","is","dropped",".","This","is","an","alternative","regularization","to","shrinkage",",","i.e.",",","setting","`","learning_rate","<","1.0","`",".","Values","must","be","in","the","range","`","[","0.0",",","1.0",")","`",".","random_state",":","int","seed",",","RandomState","instance",",","or","None",",","default",":","None","The","seed","of","the","pseudo","random","number","generator","to","use","when","shuffling","the","data",".","verbose",":","int",",","default",":","0","Enable","verbose","output",".","If","1","then","it","prints","progress","and","performance","once","in","a","while",".","Values","must","be","in","the","range","`","[","0",",","inf",")","`",".","Attributes","--","--","--","--","--","coef_",":","array",",","shape","=","(","n_features","+","1",",",")","The","aggregated","coefficients",".","The","first","element","`","coef\\_","[","0","]","`","corresponds","to","the","intercept",".","If","loss","is","`","coxph","`",",","the","intercept","will","always","be","zero",".","estimators_",":","list","of","base","learners","The","collection","of","fitted","sub-estimators",".","train_score_",":","array",",","shape","=","(","n_estimators",",",")","The","i-th","score","``","train_score_","[","i","]","``","is","the","deviance","(","=","loss",")","of","the","model","at","iteration","``","i","``","on","the","in-bag","sample",".","If","``","subsample","==","1","``","this","is","the","deviance","on","the","training","data",".","oob_improvement_",":","array",",","shape","=","(","n_estimators",",",")","The","improvement","in","loss","(","=","deviance",")","on","the","out-of-bag","samples","relative","to","the","previous","iteration",".","``","oob_improvement_","[","0","]","``","is","the","improvement","in","loss","of","the","first","stage","over","the","``","init","``","estimator",".","n_features_in_",":","int","Number","of","features","seen","during","``","fit","``",".","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during","``","fit","``",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","unique_times_",":","array","of","shape","=","(","n_unique_times",",",")","Unique","time","points",".","References","--","--","--","--","--","..","[","1","]","Hothorn",",","T.",",","B\u00fchlmann",",","P.",",","Dudoit",",","S.",",","Molinaro",",","A.",",","van","der","Laan",",","M.","J.",",","``","Survival","ensembles","''",",","Biostatistics",",","7","(","3",")",",","355-73",",","2006"]
code: def _get_baseline_model(self):
      if self._baseline_model is None:
          raise ValueError(
              "`fit` must be called with the loss option set to 'coxph'."
          )
      return self._baseline_model
  
imports: import numbers
  import numpy
  from scipy.sparse import csc_matrix, csr_matrix, issparse
  from sklearn.base import BaseEstimator
  from sklearn.ensemble._base import BaseEnsemble
  from sklearn.ensemble._gb import BaseGradientBoosting, VerboseReporter
  from sklearn.ensemble._gradient_boosting import _random_sample_mask
  from sklearn.model_selection import train_test_split
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.tree._tree import DTYPE
  from sklearn.utils import check_consistent_length, check_random_state, column_or_1d
  from sklearn.utils._param_validation import Interval, StrOptions
  from sklearn.utils.extmath import squared_norm
  from sklearn.utils.validation import check_is_fitted
  from ..base import SurvivalAnalysisMixin
  from ..linear_model.coxph import BreslowEstimator
  from ..util import check_array_survival
  from .survival_loss import LOSS_FUNCTIONS, CensoredSquaredLoss, CoxPH, IPCWLeastSquaresError
label_desc: Use image node_id 7 for calling the ComponentwiseGradientBoostingSurvivalAnalysis obj's underlying member method code with example usage: obj._get_baseline_model() and returns: self