本文整理汇总了Python中lifelines.estimation.NelsonAalenFitter.plot方法的典型用法代码示例。如果您正苦于以下问题:Python NelsonAalenFitter.plot方法的具体用法?Python NelsonAalenFitter.plot怎么用?Python NelsonAalenFitter.plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lifelines.estimation.NelsonAalenFitter
的用法示例。
在下文中一共展示了NelsonAalenFitter.plot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_naf_plotting_with_custom_colours
# 需要导入模块: from lifelines.estimation import NelsonAalenFitter [as 别名]
# 或者: from lifelines.estimation.NelsonAalenFitter import plot [as 别名]
def test_naf_plotting_with_custom_colours(self, block):
data1 = np.random.exponential(5, size=(200, 1))
data2 = np.random.exponential(1, size=(500))
naf = NelsonAalenFitter()
naf.fit(data1)
ax = naf.plot(color="r")
naf.fit(data2)
naf.plot(ax=ax, c="k")
self.plt.title('test_naf_plotting_with_custom_coloirs')
self.plt.show(block=block)
return
示例2: test_naf_plotting_slice
# 需要导入模块: from lifelines.estimation import NelsonAalenFitter [as 别名]
# 或者: from lifelines.estimation.NelsonAalenFitter import plot [as 别名]
def test_naf_plotting_slice(self, block):
data1 = np.random.exponential(5, size=(200, 1))
data2 = np.random.exponential(1, size=(200, 1))
naf = NelsonAalenFitter()
naf.fit(data1)
ax = naf.plot(ix=slice(0, None))
naf.fit(data2)
naf.plot(ax=ax, ci_force_lines=True, iloc=slice(100, 180))
self.plt.title('test_naf_plotting_slice')
self.plt.show(block=block)
return
示例3: test_naf_plot_cumulative_hazard
# 需要导入模块: from lifelines.estimation import NelsonAalenFitter [as 别名]
# 或者: from lifelines.estimation.NelsonAalenFitter import plot [as 别名]
def test_naf_plot_cumulative_hazard(self, block):
data1 = np.random.exponential(5, size=(200, 1))
naf = NelsonAalenFitter()
naf.fit(data1)
ax = naf.plot()
naf.plot_cumulative_hazard(ax=ax, ci_force_lines=True)
self.plt.title("I should have plotted the same thing, but different styles + color!")
self.plt.show(block=block)
return
示例4: get_ipython
# 需要导入模块: from lifelines.estimation import NelsonAalenFitter [as 别名]
# 或者: from lifelines.estimation.NelsonAalenFitter import plot [as 别名]
# In[23]:
get_ipython().magic(u'R p <- plot.ly("https://plot.ly/~rmdk/185/cumulativehazard-vs-time/")')
# pass object to python kernel
get_ipython().magic(u'R -o p')
# Render HTML
HTML(p[0])
# ### Using Python
# In[26]:
from lifelines.estimation import NelsonAalenFitter
naf = NelsonAalenFitter()
naf.fit(T, event_observed=C)
naf.plot(title='Nelson-Aalen Estimate')
# In[27]:
naf.plot(ci_force_lines=True, title='Nelson-Aalen Estimate')
py_p = plt.gcf()
pyplot(py_p, legend=False)