class_docstr: This class implements a Weibull AFT model. The model has parameterized
  form, with :math:`\lambda(x) = \exp\left(\beta_0 + \beta_1x_1 + ... + \beta_n x_n \right)`,
  and optionally, :math:`\rho(y) = \exp\left(\alpha_0 + \alpha_1 y_1 + ... + \alpha_m y_m \right)`,
  
  .. math::  S(t; x, y) = \exp\left(-\left(\frac{t}{\lambda(x)}\right)^{\rho(y)}\right),
  
  With no covariates, the Weibull model's parameters has the following interpretations: The :math:`\lambda` (scale) parameter has an
  applicable interpretation: it represent the time when 37% of the population has died.
  The :math:`\rho` (shape) parameter controls if the cumulative hazard (see below) is convex or concave, representing accelerating or decelerating
  hazards.
  
  The cumulative hazard rate is
  
  .. math:: H(t; x, y) = \left(\frac{t}{\lambda(x)} \right)^{\rho(y)},
  
  After calling the ``.fit`` method, you have access to properties like:
  ``params_``, ``print_summary()``. A summary of the fit is available with the method ``print_summary()``.
  
  
  Parameters
  -----------
  alpha: float, optional (default=0.05)
      the level in the confidence intervals.
  
  fit_intercept: boolean, optional (default=True)
      Allow lifelines to add an intercept column of 1s to df, and ancillary if applicable.
  
  penalizer: float or array, optional (default=0.0)
      the penalizer coefficient to the size of the coefficients. See `l1_ratio`. Must be equal to or greater than 0.
      Alternatively, penalizer is an array equal in size to the number of parameters, with penalty coefficients for specific variables. For
      example, `penalizer=0.01 * np.ones(p)` is the same as `penalizer=0.01`
  
  l1_ratio: float, optional (default=0.0)
      how much of the penalizer should be attributed to an l1 penalty (otherwise an l2 penalty). The penalty function looks like
      ``penalizer * l1_ratio * ||w||_1 + 0.5 * penalizer * (1 - l1_ratio) * ||w||^2_2``
  
  model_ancillary: optional (default=False)
      set the model instance to always model the ancillary parameter with the supplied Dataframe.
      This is useful for grid-search optimization.
  
  Attributes
  ----------
  params_ : DataFrame
      The estimated coefficients
  confidence_intervals_ : DataFrame
      The lower and upper confidence intervals for the coefficients
  durations: Series
      The event_observed variable provided
  event_observed: Series
      The event_observed variable provided
  weights: Series
      The event_observed variable provided
  variance_matrix_ : DataFrame
      The variance matrix of the coefficients
  standard_errors_: Series
      the standard errors of the estimates
  score_: float
      the concordance index of the model.
class_docstr_tok: ["This","class","implements","a","Weibull","AFT","model",".","The","model","has","parameterized","form",",","with",":","math",":","`","\\lambda","(","x",")","=","\\exp\\left","(","\\beta_0","+","\\beta_1x_1","+","...","+","\\beta_n","x_n","\\right",")","`",",","and","optionally",",",":","math",":","`","\\rho","(","y",")","=","\\exp\\left","(","\\alpha_0","+","\\alpha_1","y_1","+","...","+","\\alpha_m","y_m","\\right",")","`",",","..","math",":",":","S","(","t",";","x",",","y",")","=","\\exp\\left","(","-\\left","(","\\frac","{","t","}","{","\\lambda","(","x",")","}","\\right",")","^","{","\\rho","(","y",")","}","\\right",")",",","With","no","covariates",",","the","Weibull","model","'s","parameters","has","the","following","interpretations",":","The",":","math",":","`","\\lambda","`","(","scale",")","parameter","has","an","applicable","interpretation",":","it","represent","the","time","when","37","%","of","the","population","has","died",".","The",":","math",":","`","\\rho","`","(","shape",")","parameter","controls","if","the","cumulative","hazard","(","see","below",")","is","convex","or","concave",",","representing","accelerating","or","decelerating","hazards",".","The","cumulative","hazard","rate","is","..","math",":",":","H","(","t",";","x",",","y",")","=","\\left","(","\\frac","{","t","}","{","\\lambda","(","x",")","}","\\right",")","^","{","\\rho","(","y",")","}",",","After","calling","the","``",".fit","``","method",",","you","have","access","to","properties","like",":","``","params_","``",",","``","print_summary","(",")","``",".","A","summary","of","the","fit","is","available","with","the","method","``","print_summary","(",")","``",".","Parameters","--","--","--","--","--","-","alpha",":","float",",","optional","(","default=0.05",")","the","level","in","the","confidence","intervals",".","fit_intercept",":","boolean",",","optional","(","default=True",")","Allow","lifelines","to","add","an","intercept","column","of","1s","to","df",",","and","ancillary","if","applicable",".","penalizer",":","float","or","array",",","optional","(","default=0.0",")","the","penalizer","coefficient","to","the","size","of","the","coefficients",".","See","`","l1_ratio","`",".","Must","be","equal","to","or","greater","than","0",".","Alternatively",",","penalizer","is","an","array","equal","in","size","to","the","number","of","parameters",",","with","penalty","coefficients","for","specific","variables",".","For","example",",","`","penalizer=0.01","*","np.ones","(","p",")","`","is","the","same","as","`","penalizer=0.01","`","l1_ratio",":","float",",","optional","(","default=0.0",")","how","much","of","the","penalizer","should","be","attributed","to","an","l1","penalty","(","otherwise","an","l2","penalty",")",".","The","penalty","function","looks","like","``","penalizer","*","l1_ratio","*","||w||_1","+","0.5","*","penalizer","*","(","1","-","l1_ratio",")","*","||w||^2_2","``","model_ancillary",":","optional","(","default=False",")","set","the","model","instance","to","always","model","the","ancillary","parameter","with","the","supplied","Dataframe",".","This","is","useful","for","grid-search","optimization",".","Attributes","--","--","--","--","--","params_",":","DataFrame","The","estimated","coefficients","confidence_intervals_",":","DataFrame","The","lower","and","upper","confidence","intervals","for","the","coefficients","durations",":","Series","The","event_observed","variable","provided","event_observed",":","Series","The","event_observed","variable","provided","weights",":","Series","The","event_observed","variable","provided","variance_matrix_",":","DataFrame","The","variance","matrix","of","the","coefficients","standard_errors_",":","Series","the","standard","errors","of","the","estimates","score_",":","float","the","concordance","index","of","the","model","."]
code: def _log_hazard(
      self,
      params: Union[DictBox, Dict[str, np.array]],
      T: Union[float, np.array],
      Xs: DataframeSlicer,
  ) -> Union[np.array, ArrayBox]:
      lambda_params = params["lambda_"]
      log_lambda_ = Xs["lambda_"] @ lambda_params
  
      rho_params = params["rho_"]
      log_rho_ = Xs["rho_"] @ rho_params
  
      return (
          log_rho_
          - log_lambda_
          + np.expm1(log_rho_) * (np.log(T) - log_lambda_)
      )
  
imports: from autograd import numpy
  from autograd.builtins import DictBox
  from autograd.numpy.numpy_boxes import ArrayBox
  from typing import Dict, List, Optional, Union
  from scipy.special import gamma
  import pandas
  from lifelines.utils import _get_index
  from lifelines.fitters import ParametericAFTRegressionFitter
  from lifelines.fitters.mixins import ProportionalHazardMixin
  from lifelines.utils.safe_exp import safe_exp
  from lifelines.utils import DataframeSlicer
  from lifelines.statistics import proportional_hazard_test
label_desc: Use image node_id 4 for calling the WeibullAFTFitter obj's underlying member method code with example usage: obj._log_hazard(params, T, Xs) and returns: unknown