While trying the Weibull AFT Fitter, I used the 'check_assumptions' method to verify the PH assumption. I got the error "TypeError: compute_residuals() got an unexpected keyword argument 'kind'". Can you help me with this?
Also, I noticed that the package API reference (on lifelines documentation website) for WeibullAFTFitter() uses CoxPHFitter() for the check_assumptions method. Is there any difference in the method syntax between the method of the two fitters?
Code:
# Data preparation
import lifelines
from lifelines import datasets
lung_dataset = datasets.load_lung().dropna()
lung_dataset['event'] = lung_dataset['status']-1
# Best fit check
lifelines.utils.find_best_parametric_model(lung_dataset['time'],lung_dataset['event'])
# Result recommends WeibullFitter - Hence, going ahead with WeibullAFTFitter
#Fitting the model
WeibullAFT = lifelines.WeibullAFTFitter().fit(lung_dataset.drop('status', axis = 1), duration_col = 'time',event_col = 'event')
#Assumption check
WeibullAFT.check_assumptions(lung_dataset.drop('status', axis = 1))
Hi,
While trying the Weibull AFT Fitter, I used the 'check_assumptions' method to verify the PH assumption. I got the error "TypeError: compute_residuals() got an unexpected keyword argument 'kind'". Can you help me with this?
Also, I noticed that the package API reference (on lifelines documentation website) for WeibullAFTFitter() uses CoxPHFitter() for the check_assumptions method. Is there any difference in the method syntax between the method of the two fitters?
Code:
Thanks