class_docstr: Class for fitting the Nelson-Aalen estimate for the cumulative hazard.
  
  NelsonAalenFitter(alpha=0.05, nelson_aalen_smoothing=True)
  
  Parameters
  ----------
  alpha: float, optional (default=0.05)
      The alpha value associated with the confidence intervals.
  nelson_aalen_smoothing: bool, optional
      If the event times are naturally discrete (like discrete years, minutes, etc.)
    then it is advisable to turn this parameter to False. See [1], pg.84.
  
  Notes
  ------
  [1] Aalen, O., Borgan, O., Gjessing, H., 2008. Survival and Event History Analysis
  
  Attributes
  ----------
  cumulative_hazard_ : DataFrame
      The estimated cumulative hazard (with custom timeline if provided)
  confidence_interval_ : DataFrame
      The lower and upper confidence intervals for the cumulative hazard
  durations: array
      The durations provided
  event_observed: array
      The event_observed variable provided
  timeline: array
      The time line to use for plotting and indexing
  entry: array or None
      The entry array provided, or None
  event_table: DataFrame
      A summary of the life table
docstr: Parameters
  -----------
  durations: an array, or pd.Series, of length n
    duration subject was observed for
  timeline: iterable
      return the best estimate at the values in timelines (positively increasing)
  event_observed: an array, or pd.Series, of length n
      True if the the death was observed, False if the event was lost (right-censored). Defaults all True if event_observed==None
  entry: an array, or pd.Series, of length n
     relative time when a subject entered the study. This is
     useful for left-truncated observations, i.e the birth event was not observed.
     If None, defaults to all 0 (all birth events observed.)
  label: string
      a string to name the column of the estimate.
  alpha: float
      the alpha value in the confidence intervals. Overrides the initializing
     alpha for this call to fit only.
  ci_labels: iterable
      add custom column names to the generated confidence intervals as a length-2 list: [<lower-bound name>, <upper-bound name>]. Default: <label>_lower_<1-alpha/2>
  weights: n array, or pd.Series, of length n
      if providing a weighted dataset. For example, instead
      of providing every subject as a single element of `durations` and `event_observed`, one could
      weigh subject differently.
  fit_options:
      Not used
  
  Returns
  -------
    self, with new properties like ``cumulative_hazard_``.
docstr_tok: ["Parameters","--","--","--","--","--","-","durations",":","an","array",",","or","pd.Series",",","of","length","n","duration","subject","was","observed","for","timeline",":","iterable","return","the","best","estimate","at","the","values","in","timelines","(","positively","increasing",")","event_observed",":","an","array",",","or","pd.Series",",","of","length","n","True","if","the","the","death","was","observed",",","False","if","the","event","was","lost","(","right-censored",")",".","Defaults","all","True","if","event_observed==None","entry",":","an","array",",","or","pd.Series",",","of","length","n","relative","time","when","a","subject","entered","the","study",".","This","is","useful","for","left-truncated","observations",",","i.e","the","birth","event","was","not","observed",".","If","None",",","defaults","to","all","0","(","all","birth","events","observed",".",")","label",":","string","a","string","to","name","the","column","of","the","estimate",".","alpha",":","float","the","alpha","value","in","the","confidence","intervals",".","Overrides","the","initializing","alpha","for","this","call","to","fit","only",".","ci_labels",":","iterable","add","custom","column","names","to","the","generated","confidence","intervals","as","a","length-2","list",":","[","<","lower-bound","name",">",",","<","upper-bound","name",">","]",".","Default",":","<","label",">","_lower_","<","1-alpha\/2",">","weights",":","n","array",",","or","pd.Series",",","of","length","n","if","providing","a","weighted","dataset",".","For","example",",","instead","of","providing","every","subject","as","a","single","element","of","`","durations","`","and","`","event_observed","`",",","one","could","weigh","subject","differently",".","fit_options",":","Not","used","Returns","--","--","--","-","self",",","with","new","properties","like","``","cumulative_hazard_","``","."]
code: def fit(
      self,
      durations,
      event_observed=None,
      timeline=None,
      entry=None,
      label=None,
      alpha=None,
      ci_labels=None,
      weights=None,
      fit_options=None,
  ):  # pylint: disable=too-many-arguments
      """
      Parameters
      -----------
      durations: an array, or pd.Series, of length n
        duration subject was observed for
      timeline: iterable
          return the best estimate at the values in timelines (positively increasing)
      event_observed: an array, or pd.Series, of length n
          True if the the death was observed, False if the event was lost (right-censored). Defaults all True if event_observed==None
      entry: an array, or pd.Series, of length n
         relative time when a subject entered the study. This is
         useful for left-truncated observations, i.e the birth event was not observed.
         If None, defaults to all 0 (all birth events observed.)
      label: string
          a string to name the column of the estimate.
      alpha: float
          the alpha value in the confidence intervals. Overrides the initializing
         alpha for this call to fit only.
      ci_labels: iterable
          add custom column names to the generated confidence intervals as a length-2 list: [<lower-bound name>, <upper-bound name>]. Default: <label>_lower_<1-alpha/2>
      weights: n array, or pd.Series, of length n
          if providing a weighted dataset. For example, instead
          of providing every subject as a single element of `durations` and `event_observed`, one could
          weigh subject differently.
      fit_options:
          Not used
  
      Returns
      -------
        self, with new properties like ``cumulative_hazard_``.
  
      """
      durations = np.asarray(durations)
      check_nans_or_infs(durations)
      if event_observed is not None:
          event_observed = np.asarray(event_observed)
          check_nans_or_infs(event_observed)
  
      if weights is not None:
          if (weights.astype(int) != weights).any():
              warnings.warn(
                  """It looks like your weights are not integers, possibly propensity scores then?
    It's important to know that the naive variance estimates of the coefficients are biased. Instead use Monte Carlo to
    estimate the variances. See paper "Variance estimation when using inverse probability of treatment weighting (IPTW) with survival analysis"
    or "Adjusted Kaplan-Meier estimator and log-rank test with inverse probability of treatment weighting for survival data."
                    """,
                  StatisticalWarning,
              )
  
      (
          self.durations,
          self.event_observed,
          self.timeline,
          self.entry,
          self.event_table,
          self.weights,
      ) = _preprocess_inputs(
          durations, event_observed, timeline, entry, weights
      )
  
      cumulative_hazard_, cumulative_sq_ = _additive_estimate(
          self.event_table,
          self.timeline,
          self._additive_f,
          self._variance_f,
          False,
      )
  
      # estimates
      self._label = coalesce(label, self._label, "NA_estimate")
      self.cumulative_hazard_ = pd.DataFrame(
          cumulative_hazard_, columns=[self._label]
      )
      self.confidence_interval_ = self._bounds(
          cumulative_sq_.values[:, None],
          alpha if alpha else self.alpha,
          ci_labels,
      )
      self.confidence_interval_cumulative_hazard_ = (
          self.confidence_interval_
      )
      self._cumulative_sq = cumulative_sq_
  
      # estimation methods
      self._estimation_method = "cumulative_hazard_"
      self._estimate_name = "cumulative_hazard_"
  
      # plotting
      self.plot_cumulative_hazard = self.plot
  
      return self
  
imports: import warnings
  import numpy
  import pandas
  from lifelines.fitters import UnivariateFitter
  from lifelines.plotting import _plot_estimate
  from lifelines.exceptions import StatisticalWarning
  from lifelines.utils import _preprocess_inputs, _additive_estimate, epanechnikov_kernel, inv_normal_cdf, check_nans_or_infs, CensoringType, coalesce, _to_1d_array
label_desc: Use image node_id 2 for calling the NelsonAalenFitter obj's underlying member method code with example usage: obj.fit(durations, event_observed, timeline, entry, label, alpha, ci_labels, weights, fit_options) and returns: self