我正在尝试使用Bokeh创建具有不确定性(阴影区域间隔)的生存曲线图,例如:http://lifelines.readthedocs.io/en/latest/Examples.html
我尝试使用补丁,但是没有用。
有什么建议吗?
import pandas as pd
from lifelines.datasets import load_dd
data = load_dd()
from lifelines import KaplanMeierFitter
kmf = KaplanMeierFitter()
T = data["duration"]
E = data["observed"]
kmf.fit(T, event_observed=E)
x = kmf.survival_function_.reset_index().timeline
y = kmf.survival_function_.reset_index().KM_estimate
plot = figure( x_axis_label='Days',
y_axis_label='Survival'
)
plot.step(x=x, y=y)
show(plot)
kmf.confidence_interval_