Impute
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 Impute(strategy: str = 'mean')[source]
Bases:
objectReplace non-finite feature values with a learned per-column statistic.
Every other method assumes finite input: a quantile computed over a column containing infinity is meaningless, and scikit-learn refuses NaN outright. So this belongs FIRST in a chain, and both chains insert it automatically when a configuration does not name it – recording it in their spec, so the step is never applied invisibly.
v0.1 ran this logic as a hard-coded prologue rather than a configurable step, which left the strategy unreachable from a study’s configuration even though the underlying helper already supported alternatives.
- Parameters:
strategy –
meanormedianof each column’s finite values, orzero. Columns with no finite value at all impute to 0.0 regardless, so one unusable modality cannot invalidate a subject.