PowerTransformer<T>

Models & Types · AiDotNet.Preprocessing.PowerTransforms

Applies power transformations (Box-Cox or Yeo-Johnson) to make data more Gaussian-like.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → PowerTransformer<T>

For Beginners

This transformer makes your data more “bell-curve shaped”:

  • Box-Cox: For strictly positive data (prices, counts)
  • Yeo-Johnson: Works with any data including negatives and zeros

After transformation, features will have more normal (Gaussian) distributions, which helps many machine learning algorithms perform better.

How It Works

PowerTransformer applies a power transformation to each feature to make it more Gaussian-like. Box-Cox requires strictly positive data, while Yeo-Johnson works with any values. The transformation can help stabilize variance and improve the fit of models that assume normality.

Constructors

Constructor Summary
PowerTransformer(PowerTransformMethod method, bool standardize, int[] columnIndices) Creates a new instance of PowerTransformer.

Properties

Property Summary
PowerTransformMethod Method { get; } Gets the power transformation method used.
Vector<T> Lambdas { get; } Gets the optimal lambda parameters for each feature.
bool Standardize { get; } Gets whether standardization is applied after transformation.
bool SupportsInverseTransform { get; } Gets whether this transformer supports inverse transformation.

Methods

Method Summary
string[] GetFeatureNamesOut(string[] inputFeatureNames) Gets the output feature names after transformation.