FeatureWhitelist
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 FeatureWhitelist(features: Sequence[str])[source]
Bases:
objectRestrict the feature matrix to an explicit, externally derived list.
This is the bridge from a precision screen to habitat computation: the
PreciseFeatureSetnames the features that survived, and this method makes a habitat spec cluster exactly those – the workflow of Prior et al. (Radiol Artif Intell 2024;6(2):e230118), where only precise features may define habitats.Unlike the data-driven filters, the column list is a CONSTRUCTOR argument: nothing is learned from the matrix, so the method is leakage-free by construction and
fitsimply echoes the list.- Parameters:
features – Feature names to keep, in output order. At least one is required, and every name must be present in the matrix – a
raises (missing feature breaks the "same features" contract and)
dropped. (rather than being silently)