Feature engineering and dimensionality reduction module.
tuiml.features module provides a comprehensive set of tools for transforming, selecting, and extracting meaningful features from raw data. It follows the scikit-learn API pattern for transformations.This module is organized into three main functional areas:
VarianceThresholdSelector,
CFSSelector, etc.
SequentialFeatureSelector,
WrapperSelector, etc.
PCAExtractor: Principal Component Analysis.
RandomProjectionExtractor: Johnson-Lindenstrauss based reduction.
PolynomialFeaturesGenerator: Feature interactions.
BinningFeaturesGenerator: Discretization of continuous values.
MathematicalFeaturesGenerator: Functional transformations.
Selecting top-k features using Correlation-based Feature Selection (CFS):
>>> from tuiml.features.selection import CFSSelector
>>> import numpy as np
>>> X, y = np.random.randn(50, 20), np.random.randint(0, 2, 50)
>>> selector = CFSSelector()
>>> X_selected = selector.fit_transform(X, y)
>>> print(f"Reduced to {X_selected.shape[1]} features")
Extracting principal components:
>>> from tuiml.features.extraction import PCAExtractor
>>> pca = PCAExtractor(n_components=0.95)
>>> X_pca = pca.fit_transform(X)