FeatureUnion<T>

Models & Types ยท AiDotNet.Preprocessing

Concatenates results from multiple transformers horizontally.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ†’ FeatureUnion<T>

For Beginners

Sometimes you want multiple feature sets from the same data:

  • Polynomial features from numeric columns
  • Statistics (mean, std) from time windows
  • Both PCA and manual feature engineering

FeatureUnion runs all transformers and combines their outputs side by side.

How It Works

FeatureUnion applies multiple transformers to the same input data and concatenates their outputs into a single feature matrix. This is useful for combining different feature extraction methods.

Each transformer receives the full input matrix and produces its own output. All outputs are then concatenated column-wise.

Constructors

Constructor Summary
FeatureUnion() Creates a new instance of FeatureUnion.

Properties

Property Summary
bool SupportsInverseTransform { get; } Gets whether this transformer supports inverse transformation.

Methods

Method Summary
Dictionary<string, int> GetTransformerOutputWidths() Gets the number of output features from each transformer.
FeatureUnion<T> Add(IDataTransformer<T, Matrix<T>, Matrix<T>> transformer) Adds a transformer to the union.
FeatureUnion<T> Add(string name, IDataTransformer<T, Matrix<T>, Matrix<T>> transformer) Adds a transformer to the union.
IDataTransformer<T, Matrix<T>, Matrix<T>> GetTransformer(string name) Gets the transformer with the specified name.
string[] GetFeatureNamesOut(string[] inputFeatureNames) Gets the output feature names after transformation.
string[] GetTransformerNames() Gets all transformer names.