TransformerBase<T, TInput, TOutput>

Base Classes · AiDotNet.Preprocessing

Abstract base class for all data transformers providing common functionality.

Implements: IDataTransformer<T, TInput, TOutput>

Known derived types: ANCOVASelector<T>, ANOVAFTest<T>, ANOVASelector<T>, ANOVASelector<T>, ANOVA<T>, ARDSelector<T>, AdaptiveFeatureSelector<T>, AdjustedMutualInformation<T>, AlphaInvesting<T>, AntColonyFS<T>, AntColonyOptimization<T>, AntColonySelector<T>, ApproximateEntropySelector<T>, AprioriBasedSelector<T>, ArtificialBeeColony<T>, AttentionBasedSelector<T>, AttentionFlowSelector<T>, AutocorrelationFS<T>, AutocorrelationSelector<T>, AutocorrelationSelector<T>, AutoencoderSelector<T>, BackwardDifferenceEncoder<T>, BackwardElimination<T>, BaggingFeatureSelector<T>, BanzhafFeatureSelector<T>, BaseNEncoder<T>, BatAlgorithmFS<T>, BatAlgorithm<T>, BayesianFeatureSelector<T>, BayesianModelAveraging<T>, BayesianNetworkSelector<T>, BenjaminiHochberg<T>, BhattacharyyaDistanceSelector<T>, BidirectionalSearch<T>, BidirectionalSelection<T>, BimodalitySelector<T>, Binarizer<T>, BinaryEncoder<T>, BisectingKMeansSelector<T>, BoostingFeatureSelector<T>, BootstrapFS<T>, BootstrapSelection<T>, BootstrapSelector<T>, BootstrapStabilitySelector<T>, BorutaFS<T>, BorutaSelector<T>, Boruta<T>, Boruta<T>, BudgetConstrainedFS<T>, CFS<T>, CIFE<T>, CMIMSelector<T>, CMIM<T>, CMIM<T>, CatBoostEncoder<T>, CausalDiscoverySelector<T>, ChebyshevDistanceSelector<T>, ChiSquareTest<T>, ChiSquareText<T>, ChiSquare<T> (+449 more)

For Beginners

This is the foundation that all transformers build on. It provides common features like:

  • Checking if the transformer is ready to use
  • Managing which columns to transform
  • Serialization for saving/loading transformers

When creating a new transformer, you extend this class and implement the abstract methods.

How It Works

This class provides the template method pattern for data transformation. Derived classes implement the core fitting and transformation logic while this base class handles validation, state management, and common operations.

Properties

Property Summary
bool IsFitted { get; set; } 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.
TOutput FitTransform(TInput data) Fits the transformer and transforms the data in a single step.
TOutput Transform(TInput data) Transforms the input data using fitted parameters.
string[] GetFeatureNamesOut(string[] inputFeatureNames) Gets the output feature names after transformation.
void Fit(TInput data) Fits the transformer to the training data.