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: Minimize negative partial log-likelihood for provided data.
  
  Parameters
  ----------
  X : array-like, shape = (n_samples, n_features)
      Data matrix
  
  y : structured array, shape = (n_samples,)
      A structured array containing the binary event indicator
      as first field, and time of event or time of censoring as
      second field.
  
  Returns
  -------
  self
docstr_tok: ["Minimize","negative","partial","log-likelihood","for","provided","data",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","=","(","n_samples",",","n_features",")","Data","matrix","y",":","structured","array",",","shape","=","(","n_samples",",",")","A","structured","array","containing","the","binary","event","indicator","as","first","field",",","and","time","of","event","or","time","of","censoring","as","second","field",".","Returns","--","--","--","-","self"]
code: def fit(self, X, y):
      """Minimize negative partial log-likelihood for provided data.
  
      Parameters
      ----------
      X : array-like, shape = (n_samples, n_features)
          Data matrix
  
      y : structured array, shape = (n_samples,)
          A structured array containing the binary event indicator
          as first field, and time of event or time of censoring as
          second field.
  
      Returns
      -------
      self
      """
      self._validate_params()
  
      X = self._validate_data(X, ensure_min_samples=2, dtype=np.float64)
      event, time = check_array_survival(X, y)
  
      if isinstance(self.alpha, (numbers.Real, numbers.Integral)):
          alphas = np.empty(X.shape[1], dtype=float)
          alphas[:] = self.alpha
      else:
          alphas = self.alpha
  
      alphas = check_array(
          alphas,
          ensure_2d=False,
          ensure_min_samples=0,
          estimator=self,
          input_name="alpha",
      )
      if np.any(alphas < 0):
          raise ValueError(
              f"alpha must be positive, but was {self.alpha!r}"
          )
      if alphas.shape[0] != X.shape[1]:
          raise ValueError(
              f"Length alphas ({alphas.shape[0]}) must match number of features ({X.shape[1]})."
          )
  
      optimizer = CoxPHOptimizer(X, event, time, alphas, self.ties)
  
      verbose_reporter = VerboseReporter(self.verbose)
      w = np.zeros(X.shape[1])
      w_prev = w
      i = 0
      loss = float("inf")
      while True:
          if i >= self.n_iter:
              verbose_reporter.end_max_iter(i)
              warnings.warn(
                  (
                      "Optimization did not converge: Maximum number of iterations has been exceeded."
                  ),
                  stacklevel=2,
                  category=ConvergenceWarning,
              )
              break
  
          optimizer.update(w)
          delta = solve(
              optimizer.hessian,
              optimizer.gradient,
              overwrite_a=False,
              overwrite_b=False,
              check_finite=False,
          )
  
          if not np.all(np.isfinite(delta)):
              raise ValueError(
                  "search direction contains NaN or infinite values"
              )
  
          w_new = w - delta
          loss_new = optimizer.nlog_likelihood(w_new)
          verbose_reporter.update(i, delta, loss_new)
          if loss_new > loss:
              # perform step-halving if negative log-likelihood does not decrease
              w = (w_prev + w) / 2
              loss = optimizer.nlog_likelihood(w)
              verbose_reporter.step_halving(i, loss)
              i += 1
              continue
  
          w_prev = w
          w = w_new
  
          res = np.abs(1 - (loss_new / loss))
          if res < self.tol:
              verbose_reporter.end_converged(i)
              break
  
          loss = loss_new
          i += 1
  
      self.coef_ = w
      self._baseline_model.fit(np.dot(X, self.coef_), event, time)
      return self
  
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 5 for calling the CoxPHSurvivalAnalysis obj's underlying member method code with example usage: obj.fit(X, y) and returns: self