class_docstr: Below is an implementation of Crowther, Royston, Clements AFT cubic spline models. Internally, lifelines
  uses this for survival model probability calibration, but it can also be useful for a highly flexible AFT model.
  
  
  
  Parameters
  -----------
  
  n_baseline_knots: int
      the number of knots in the cubic spline.
  
  
  References
  ------------
  Crowther MJ, Royston P, Clements M. A flexible parametric accelerated failure time model.
  
  
  Examples
  ---------
  .. code:: python
  
      from lifelines import datasets, CRCSplineFitter
      rossi = datasets.load_rossi()
  
      regressors = {"beta_": "age + C(fin)", "gamma0_": "1", "gamma1_": "1", "gamma2_": "1"}
      crc = CRCSplineFitter(n_baseline_knots=3).fit(rossi, "week", "arrest", regressors=regressors)
      crc.print_summary()
class_docstr_tok: ["Below","is","an","implementation","of","Crowther",",","Royston",",","Clements","AFT","cubic","spline","models",".","Internally",",","lifelines","uses","this","for","survival","model","probability","calibration",",","but","it","can","also","be","useful","for","a","highly","flexible","AFT","model",".","Parameters","--","--","--","--","--","-","n_baseline_knots",":","int","the","number","of","knots","in","the","cubic","spline",".","References","--","--","--","--","--","--","Crowther","MJ",",","Royston","P",",","Clements","M.","A","flexible","parametric","accelerated","failure","time","model",".","Examples","--","--","--","--","-","..","code",":",":","python","from","lifelines","import","datasets",",","CRCSplineFitter","rossi","=","datasets.load_rossi","(",")","regressors","=","{","``","beta_","''",":","``","age","+","C","(","fin",")","''",",","``","gamma0_","''",":","``","1","''",",","``","gamma1_","''",":","``","1","''",",","``","gamma2_","''",":","``","1","''","}","crc","=","CRCSplineFitter","(","n_baseline_knots=3",")",".fit","(","rossi",",","``","week","''",",","``","arrest","''",",","regressors=regressors",")","crc.print_summary","(",")"]
code: def __init__(
      self,
      n_baseline_knots: Optional[int] = None,
      knots: Optional[list] = None,
      *args,
      **kwargs,
  ):
      if n_baseline_knots is not None:
          assert n_baseline_knots > 1, "must be greater than 1"
          self.n_baseline_knots = n_baseline_knots
          self.knots = None
      elif knots is not None:
          assert len(knots) > 1
          self.knots = knots
          self.n_baseline_knots = len(self.knots)
      else:
          assert False, "Must supply n_baseline_knots or knots"
  
      self._fitted_parameter_names = ["beta_"] + [
          "gamma%d_" % i for i in range(0, self.n_baseline_knots)
      ]
      super(CRCSplineFitter, self).__init__(*args, **kwargs)
  
file_path: lifelines/lifelines/fitters/crc_spline_fitter.py
imports: from typing import Optional
  from autograd import numpy
  from lifelines.fitters import ParametricRegressionFitter
  from lifelines.fitters.mixins import SplineFitterMixin
  from lifelines.utils.safe_exp import safe_exp
label_desc: Use image node_id 1 to create a new CRCSplineFitter object from inherited base classes: SplineFitterMixin, ParametricRegressionFitter with example: obj = CRCSplineFitter(n_baseline_knots, knots)