IDataTransformer<T, TInput, TOutput>

Interfaces · AiDotNet.Interfaces

Defines a data transformer that can fit to data and transform it.

Known implementations: AudioEffectTransformer<T, TInput>, AudioEnhancementTransformer<T, TInput>, DiffusionPreprocessorBase<T>, ITimeSeriesFeatureExtractor<T>, MaskBinarizer<T>, MaskBlur<T>, MaskDilation<T>, MaskErosion<T>, MaskFeatherer<T>, MaskFromBoundingBox<T>, MaskFromPoints<T>, MaskFromSegmentation<T>, MaskInverter<T>, OutpaintingMaskGenerator<T>, PostprocessingPipeline<T, TInput, TOutput>, PreprocessingPipeline<T, TInput, TOutput>, TargetStandardScaler<T, TOutput>, TransformerBase<T, TInput, TOutput>

For Beginners

A transformer is like a recipe that:

  1. First “learns” from your training data (e.g., calculates mean and std for scaling)
  2. Then applies the same recipe to any new data

This ensures new data is processed exactly the same way as training data.

How It Works

This is the core interface for all preprocessing transformers in AiDotNet. It follows the sklearn-style Fit/Transform pattern where transformers first learn parameters from training data (Fit), then apply transformations (Transform).

Properties

Property Summary
bool IsFitted { get; } Gets whether this transformer has been fitted to data.
bool SupportsInverseTransform { get; } Gets whether this transformer supports inverse transformation.
int[] ColumnIndices { get; } Gets the column indices this transformer operates on.

Methods

Method Summary
TInput InverseTransform(TOutput data) Reverses the transformation (if supported).
TOutput FitTransform(TInput data) Fits the transformer and transforms the data in a single step.
TOutput Transform(TInput data) Transforms the input data using the fitted parameters.
string[] GetFeatureNamesOut(string[] inputFeatureNames) Gets the output feature names after transformation.
void Fit(TInput data) Fits the transformer to the training data, learning any parameters needed for transformation.