我如何从 Lifelines 中的 coxPHFitter 函数和我的变量的系数中提取基线危害
how can i extract baseline hazards from a coxPHFitter function in Lifelines and the coefficients for my variates
下面是我从文档网站上得到的示例代码。我想访问基线风险和变量的系数。
'''
from lifelines import CoxPHFitter
from lifelines.datasets import load_rossi
rossi_dataset = load_rossi()
#rossi_dataset.head()
cph = CoxPHFitter()
cph.fit(rossi_dataset, duration_col='week', event_col='arrest',)
cph.print_summary()
'''
来自生命线docs:
To access the coefficients and the baseline hazard directly, you can use params_
and baseline_hazard_
respectively.
from lifelines import CoxPHFitter
from lifelines.datasets import load_rossi
rossi_dataset = load_rossi()
#rossi_dataset.head()
cph = CoxPHFitter()
cph.fit(rossi_dataset, duration_col='week', event_col='arrest',)
print(cph.params_)
print(cph.baseline_survival_)
下面是我从文档网站上得到的示例代码。我想访问基线风险和变量的系数。 '''
from lifelines import CoxPHFitter
from lifelines.datasets import load_rossi
rossi_dataset = load_rossi()
#rossi_dataset.head()
cph = CoxPHFitter()
cph.fit(rossi_dataset, duration_col='week', event_col='arrest',)
cph.print_summary()
'''
来自生命线docs:
To access the coefficients and the baseline hazard directly, you can use
params_
andbaseline_hazard_
respectively.
from lifelines import CoxPHFitter
from lifelines.datasets import load_rossi
rossi_dataset = load_rossi()
#rossi_dataset.head()
cph = CoxPHFitter()
cph.fit(rossi_dataset, duration_col='week', event_col='arrest',)
print(cph.params_)
print(cph.baseline_survival_)