SurvivalOutcome
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- class SurvivalOutcome(time_column: str, event_column: str, event_value: Any = 1)[source]
Bases:
objectRight-censored time-to-event endpoint, e.g. overall or progression-free survival.
The two columns are declared TOGETHER because neither is interpretable alone: a follow-up time without an event indicator cannot distinguish a death at 10 months from a patient still alive at last contact, and every survival estimator, metric and plot needs both.
- time_column
Follow-up duration until the event or until censoring. Units are the study’s own (months, days); HABIT never converts them, it only requires that they be consistent within a table.
- Type:
- event_column
Event indicator. Rows where it equals
event_valueexperienced the event; all others are treated as right-censored.- Type:
- event_value
Value in
event_columndenoting an observed event. Explicit because both1/0and"Dead"/"Alive"codings are common in clinical tables, and guessing wrong inverts the entire analysis.- Type:
Any
- times(frame: DataFrame) Series[source]
Return the follow-up durations.
- Parameters:
frame – Frame carrying
time_column.- Returns:
The follow-up durations aligned to
frame.
- event_mask(frame: DataFrame) Series[source]
Return a boolean mask marking rows with an OBSERVED event.
- Parameters:
frame – Frame carrying
event_column.- Returns:
Boolean Series aligned to
frame, true where the event was observed and false where the row is right-censored.