本文整理汇总了Python中lifelines.estimation.NelsonAalenFitter.smoothed_hazard_方法的典型用法代码示例。如果您正苦于以下问题:Python NelsonAalenFitter.smoothed_hazard_方法的具体用法?Python NelsonAalenFitter.smoothed_hazard_怎么用?Python NelsonAalenFitter.smoothed_hazard_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lifelines.estimation.NelsonAalenFitter
的用法示例。
在下文中一共展示了NelsonAalenFitter.smoothed_hazard_方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_smoothing_hazard_nontied
# 需要导入模块: from lifelines.estimation import NelsonAalenFitter [as 别名]
# 或者: from lifelines.estimation.NelsonAalenFitter import smoothed_hazard_ [as 别名]
def test_smoothing_hazard_nontied(self):
T = np.random.exponential(20, size=300) ** 2
C = np.random.binomial(1, 0.8, size=300)
naf = NelsonAalenFitter()
naf.fit(T, C)
naf.smoothed_hazard_(1.)
naf.fit(T)
naf.smoothed_hazard_(1.)
示例2: test_smoothing_hazard_with_spike_at_time_0
# 需要导入模块: from lifelines.estimation import NelsonAalenFitter [as 别名]
# 或者: from lifelines.estimation.NelsonAalenFitter import smoothed_hazard_ [as 别名]
def test_smoothing_hazard_with_spike_at_time_0(self):
T = np.random.binomial(20, 0.7, size=300)
T[np.random.binomial(1, 0.3, size=300).astype(bool)] = 0
naf = NelsonAalenFitter()
naf.fit(T)
df = naf.smoothed_hazard_(bandwidth=0.1)
assert df.iloc[0].values[0] > df.iloc[1].values[0]
示例3: test_smoothing_hazard_ties_all_events_observed
# 需要导入模块: from lifelines.estimation import NelsonAalenFitter [as 别名]
# 或者: from lifelines.estimation.NelsonAalenFitter import smoothed_hazard_ [as 别名]
def test_smoothing_hazard_ties_all_events_observed(self):
T = np.random.binomial(20, 0.7, size=300)
naf = NelsonAalenFitter()
naf.fit(T)
naf.smoothed_hazard_(1.)
示例4: test_smoothing_hazard_ties
# 需要导入模块: from lifelines.estimation import NelsonAalenFitter [as 别名]
# 或者: from lifelines.estimation.NelsonAalenFitter import smoothed_hazard_ [as 别名]
def test_smoothing_hazard_ties(self):
T = np.random.binomial(20, 0.7, size=300)
C = np.random.binomial(1, 0.8, size=300)
naf = NelsonAalenFitter()
naf.fit(T, C)
naf.smoothed_hazard_(1.)