BinaryOutcome
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 BinaryOutcome(column: str, positive_label: Any = 1)[source]
Bases:
objectTwo-class endpoint, e.g. treatment response or 2-year recurrence.
- positive_label
Value denoting the POSITIVE class. Made explicit because sensitivity, PPV, ROC and decision-curve analysis are all defined relative to it, and inferring it from the data (largest label? most frequent? sorted last?) silently flips those metrics whenever the coding changes.
- Type:
Any
- positive_mask(frame: DataFrame) Series[source]
Return a boolean mask marking the positive class.
- Parameters:
frame – Frame carrying
column.- Returns:
Boolean Series aligned to
frame, true where the label equalspositive_label.