FeatureSelector

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 FeatureSelector(*args, **kwargs)[source]

Bases: Protocol

Learn and apply a feature-column subset.

Same fit/transform split as TablePreprocessor; transform restricts the table to the columns selected at fit time, so prediction data is reduced with the TRAINING selection and never re-selected.

property spec: Spec

Return the algorithm specification.

fit(table: FeatureTable, *, repeat_tables: Sequence[FeatureTable] | None = None) → FeatureSelector[source]

Learn the feature subset from a table.

Parameters:
  • table – Table with feature columns and, for supervised selectors, an outcome column.

  • repeat_tables – Optional repeated-measurement tables aligned to table by identifier columns, consumed only by stability-driven selectors (e.g. ICC test-retest filtering).

Returns:

self, fitted.

transform(table: FeatureTable) → FeatureTable[source]

Restrict a table to the fitted feature subset.

Parameters:

table – Table carrying (at least) the selected feature columns.

Returns:

A new table with only the selected feature columns.

__init__(*args, **kwargs)