Ejemplo n.º 1
0
    def test_weibull_plotting(self, block):
        T = 50 * np.random.exponential(1, size=(200, 1)) ** 2
        wf = WeibullFitter().fit(T, timeline=np.linspace(0, 5, 100))
        wf.plot_hazard()
        self.plt.title("test_weibull_plotting:hazard")
        self.plt.show(block=block)

        wf.plot_cumulative_hazard()
        self.plt.title("test_weibull_plotting:cumulative_hazard")
        self.plt.show(block=block)
        return
Ejemplo n.º 2
0
    def test_weibull_plotting(self, block):
        T = np.random.exponential(5, size=(2000, 1))**2
        wf = WeibullFitter().fit(T)
        wf.plot_hazard()
        self.plt.title("test_weibull_plotting:hazard")
        self.plt.show(block=block)

        wf.plot_cumulative_hazard()
        self.plt.title("test_weibull_plotting:cumulative_hazard")
        self.plt.show(block=block)
        return
Ejemplo n.º 3
0
    def test_label_can_be_changed_on_univariate_fitters(self, block):
        T = np.random.exponential(5, size=(2000, 1)) ** 2
        wf = WeibullFitter().fit(T, timeline=np.linspace(0, 5))
        ax = wf.plot_hazard(label="abc")

        wf.plot_cumulative_hazard(ax=ax, label="123")
        self.plt.title("test_label_can_be_changed_on_univariate_fitters")
        self.plt.show(block=block)
        return