from_lifelines
survival.from_lifelines(fitted_model, *, label=None)Build a SurvivalCurve from a fitted parametric survival model.
Reads the model’s own cumulative_hazard_at_times method, so the curve matches the fit exactly whatever family was chosen. Because the resulting cumulative hazard has no closed-form inverse in general, sampling from it falls back to heormodel.survival.curve.numeric_inverse_cumulative_hazard.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| fitted_model | FittedSurvivalModel | A fitted parametric survival model, for example the result of lifelines.WeibullFitter().fit(durations, event_observed). |
required |
| label | str | None |
Description of the curve for repr. Defaults to the fitted model’s class name. |
None |
Returns
| Name | Type | Description |
|---|---|---|
| SurvivalCurve | A SurvivalCurve at the model’s point estimate. |
Example
from lifelines import WeibullFitter # doctest: +SKIP fit = WeibullFitter().fit(durations, event_observed) # doctest: +SKIP curve = from_lifelines(fit) # doctest: +SKIP