TablePreprocessor
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 TablePreprocessor(*args, **kwargs)[source]
Bases:
ProtocolLearn and apply a feature-table transformation.
sklearn transformer semantics:
fitlearns any statistics the transformation needs (means, min/max, kept columns, …) and returnsself;transformapplies them. Components are cohort-level atfittime (statistics cross subject boundaries) and row-parallel attransformtime, which is exactly what a train/predict split needs.- fit(table: FeatureTable) TablePreprocessor[source]
Learn the transformation state from a table.
- Parameters:
table – Table whose feature columns provide the fit statistics.
- Returns:
self, fitted.
- transform(table: FeatureTable) FeatureTable[source]
Apply the fitted transformation.
- Parameters:
table – Table to transform; must carry the feature columns seen at fit time.
- Returns:
A new table with transformed feature columns and unchanged identifier/outcome columns.
- __init__(*args, **kwargs)