class_docstr: Cox proportional hazards model.
  
  There are two possible choices for handling tied event times.
  The default is Breslow's method, which considers each of the
  events at a given time as distinct. Efron's method is more
  accurate if there are a large number of ties. When the number
  of ties is small, the estimated coefficients by Breslow's and
  Efron's method are quite close. Uses Newton-Raphson optimization.
  
  See [1]_, [2]_, [3]_ for further description.
  
  Parameters
  ----------
  alpha : float, ndarray of shape (n_features,), optional, default: 0
      Regularization parameter for ridge regression penalty.
      If a single float, the same penalty is used for all features.
      If an array, there must be one penalty for each feature.
      If you want to include a subset of features without penalization,
      set the corresponding entries to 0.
  
  ties : {'breslow', 'efron'}, optional, default: 'breslow'
      The method to handle tied event times. If there are
      no tied event times all the methods are equivalent.
  
  n_iter : int, optional, default: 100
      Maximum number of iterations.
  
  tol : float, optional, default: 1e-9
      Convergence criteria. Convergence is based on the negative log-likelihood::
  
      |1 - (new neg. log-likelihood / old neg. log-likelihood) | < tol
  
  verbose : int, optional, default: 0
      Specifies the amount of additional debug information
      during optimization.
  
  Attributes
  ----------
  coef_ : ndarray, shape = (n_features,)
      Coefficients of the model
  
  cum_baseline_hazard_ : :class:`sksurv.functions.StepFunction`
      Estimated baseline cumulative hazard function.
  
  baseline_survival_ : :class:`sksurv.functions.StepFunction`
      Estimated baseline survival function.
  
  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.
  
  See also
  --------
  sksurv.linear_model.CoxnetSurvivalAnalysis
      Cox proportional hazards model with l1 (LASSO) and l2 (ridge) penalty.
  
  References
  ----------
  .. [1] Cox, D. R. Regression models and life tables (with discussion).
         Journal of the Royal Statistical Society. Series B, 34, 187-220, 1972.
  .. [2] Breslow, N. E. Covariance Analysis of Censored Survival Data.
         Biometrics 30 (1974): 89–99.
  .. [3] Efron, B. The Efficiency of Cox’s Likelihood Function for Censored Data.
         Journal of the American Statistical Association 72 (1977): 557–565.
docstr: Predict cumulative hazard function.
  
  The cumulative hazard function for an individual
  with feature vector :math:`x` is defined as
  
  .. math::
  
      H(t \mid x) = \exp(x^\top \beta) H_0(t) ,
  
  where :math:`H_0(t)` is the baseline hazard function,
  estimated by Breslow's estimator.
  
  Parameters
  ----------
  X : array-like, shape = (n_samples, n_features)
      Data matrix.
  
  return_array : boolean
      If set, return an array with the cumulative hazard rate
      for each `self.unique_times_`, otherwise an array of
      :class:`sksurv.functions.StepFunction`.
  
  Returns
  -------
  cum_hazard : ndarray
      If `return_array` is set, an array with the cumulative hazard rate
      for each `self.unique_times_`, otherwise an array of length `n_samples`
      of :class:`sksurv.functions.StepFunction` instances will be returned.
  
  Examples
  --------
  >>> import matplotlib.pyplot as plt
  >>> from sksurv.datasets import load_whas500
  >>> from sksurv.linear_model import CoxPHSurvivalAnalysis
  
  Load the data.
  
  >>> X, y = load_whas500()
  >>> X = X.astype(float)
  
  Fit the model.
  
  >>> estimator = CoxPHSurvivalAnalysis().fit(X, y)
  
  Estimate the cumulative hazard function for the first 10 samples.
  
  >>> chf_funcs = estimator.predict_cumulative_hazard_function(X.iloc[:10])
  
  Plot the estimated cumulative hazard functions.
  
  >>> for fn in chf_funcs:
  ...     plt.step(fn.x, fn(fn.x), where="post")
  ...
  >>> plt.ylim(0, 1)
  >>> plt.show()
docstr_tok: ["Predict","cumulative","hazard","function",".","The","cumulative","hazard","function","for","an","individual","with","feature","vector",":","math",":","`","x","`","is","defined","as","..","math",":",":","H","(","t","\\mid","x",")","=","\\exp","(","x^\\top","\\beta",")","H_0","(","t",")",",","where",":","math",":","`","H_0","(","t",")","`","is","the","baseline","hazard","function",",","estimated","by","Breslow","'s","estimator",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","=","(","n_samples",",","n_features",")","Data","matrix",".","return_array",":","boolean","If","set",",","return","an","array","with","the","cumulative","hazard","rate","for","each","`","self.unique_times_","`",",","otherwise","an","array","of",":","class",":","`","sksurv.functions.StepFunction","`",".","Returns","--","--","--","-","cum_hazard",":","ndarray","If","`","return_array","`","is","set",",","an","array","with","the","cumulative","hazard","rate","for","each","`","self.unique_times_","`",",","otherwise","an","array","of","length","`","n_samples","`","of",":","class",":","`","sksurv.functions.StepFunction","`","instances","will","be","returned",".","Examples","--","--","--","--",">",">",">","import","matplotlib.pyplot","as","plt",">",">",">","from","sksurv.datasets","import","load_whas500",">",">",">","from","sksurv.linear_model","import","CoxPHSurvivalAnalysis","Load","the","data",".",">",">",">","X",",","y","=","load_whas500","(",")",">",">",">","X","=","X.astype","(","float",")","Fit","the","model",".",">",">",">","estimator","=","CoxPHSurvivalAnalysis","(",")",".fit","(","X",",","y",")","Estimate","the","cumulative","hazard","function","for","the","first","10","samples",".",">",">",">","chf_funcs","=","estimator.predict_cumulative_hazard_function","(","X.iloc","[",":10","]",")","Plot","the","estimated","cumulative","hazard","functions",".",">",">",">","for","fn","in","chf_funcs",":","...","plt.step","(","fn.x",",","fn","(","fn.x",")",",","where=","''","post","''",")","...",">",">",">","plt.ylim","(","0",",","1",")",">",">",">","plt.show","(",")"]
code: def predict_cumulative_hazard_function(self, X, return_array=False):
      """Predict cumulative hazard function.
  
      The cumulative hazard function for an individual
      with feature vector :math:`x` is defined as
  
      .. math::
  
          H(t \\mid x) = \\exp(x^\\top \\beta) H_0(t) ,
  
      where :math:`H_0(t)` is the baseline hazard function,
      estimated by Breslow's estimator.
  
      Parameters
      ----------
      X : array-like, shape = (n_samples, n_features)
          Data matrix.
  
      return_array : boolean
          If set, return an array with the cumulative hazard rate
          for each `self.unique_times_`, otherwise an array of
          :class:`sksurv.functions.StepFunction`.
  
      Returns
      -------
      cum_hazard : ndarray
          If `return_array` is set, an array with the cumulative hazard rate
          for each `self.unique_times_`, otherwise an array of length `n_samples`
          of :class:`sksurv.functions.StepFunction` instances will be returned.
  
      Examples
      --------
      >>> import matplotlib.pyplot as plt
      >>> from sksurv.datasets import load_whas500
      >>> from sksurv.linear_model import CoxPHSurvivalAnalysis
  
      Load the data.
  
      >>> X, y = load_whas500()
      >>> X = X.astype(float)
  
      Fit the model.
  
      >>> estimator = CoxPHSurvivalAnalysis().fit(X, y)
  
      Estimate the cumulative hazard function for the first 10 samples.
  
      >>> chf_funcs = estimator.predict_cumulative_hazard_function(X.iloc[:10])
  
      Plot the estimated cumulative hazard functions.
  
      >>> for fn in chf_funcs:
      ...     plt.step(fn.x, fn(fn.x), where="post")
      ...
      >>> plt.ylim(0, 1)
      >>> plt.show()
      """
      return self._predict_cumulative_hazard_function(
          self._baseline_model, self.predict(X), return_array
      )
  
imports: import numbers
  import warnings
  import numpy
  from scipy.linalg import solve
  from sklearn.base import BaseEstimator
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.utils._param_validation import Interval, StrOptions
  from sklearn.utils.validation import check_array, check_is_fitted
  from ..base import SurvivalAnalysisMixin
  from ..functions import StepFunction
  from ..nonparametric import _compute_counts
  from ..util import check_array_survival
label_desc: Use image node_id 7 for calling the CoxPHSurvivalAnalysis obj's underlying member method code with example usage: obj.predict_cumulative_hazard_function(X, return_array) and returns: self