API Reference / features /

generation/

Feature generation and construction module.

This module provides tools for creating new features from existing ones through domain-agnostic mathematical operations, interactions, and discretization.

Overview

The generators are designed to augment the feature space with non-linear relationships:

  • PolynomialFeaturesGenerator: Higher-order terms.
  • InteractionFeaturesGenerator: Cross-feature products.
  • MathematicalFeaturesGenerator: Functional mappings (log, exp).
  • BinningFeaturesGenerator: Continuous to categorical mappings.

Creating interaction features:

python
>>> from tuiml.features.generation import InteractionFeaturesGenerator
>>> import numpy as np
>>> X = np.array([[1, 2], [3, 4]])
>>> gen = InteractionFeaturesGenerator()
>>> X_new = gen.fit_transform(X)

Discretizing continuous features into bins:

python
>>> from tuiml.features.generation import BinningFeaturesGenerator
>>> binner = BinningFeaturesGenerator(n_bins=5, strategy='uniform')
>>> X_binned = binner.fit_transform(X)

Modules