Table of Contents

Class PostprocessingRegistry<T, TOutput>

Namespace
AiDotNet.Postprocessing
Assembly
AiDotNet.dll

Global registry for the postprocessing pipeline.

public static class PostprocessingRegistry<T, TOutput>

Type Parameters

T

The numeric type for calculations (e.g., float, double).

TOutput

The output data type.

Inheritance
PostprocessingRegistry<T, TOutput>
Inherited Members

Remarks

PostprocessingRegistry provides a singleton pattern for managing the active postprocessing pipeline. By default, no postprocessing is applied (pass-through). Users can configure custom postprocessing via AiModelBuilder.ConfigurePostprocessing().

For Beginners: This is like a global settings panel for output processing. You don't need to interact with this directly - just use AiModelBuilder:

var result = new AiModelBuilder<double, Matrix<double>, Vector<double>>()
    .ConfigurePostprocessing(pipeline => pipeline
        .Add(new SoftmaxTransformer<double>())
        .Add(new LabelDecoder<double>(labels)))
    .ConfigureModel(new LogisticRegression<double>())
    .Build(X, y);

The configured postprocessing is automatically applied to all model outputs.

Properties

Current

Gets or sets the current postprocessing pipeline.

public static IDataTransformer<T, TOutput, TOutput>? Current { get; set; }

Property Value

IDataTransformer<T, TOutput, TOutput>

Remarks

This is set automatically when you call AiModelBuilder.ConfigurePostprocessing(). The pipeline is global and thread-safe.

For Beginners: You typically don't set this directly. Use AiModelBuilder.ConfigurePostprocessing() instead.

IsConfigured

Gets whether a postprocessing pipeline is currently configured.

public static bool IsConfigured { get; }

Property Value

bool

Methods

Clear()

Clears the current postprocessing pipeline.

public static void Clear()

Remarks

This resets the postprocessing to no-op (pass-through) behavior.

FitTransform(TOutput)

Fits the current postprocessing pipeline to data and transforms it.

public static TOutput FitTransform(TOutput output)

Parameters

output TOutput

The data to fit and transform.

Returns

TOutput

The postprocessed data, or the original output if no pipeline is configured.

Transform(TOutput)

Transforms output data using the current postprocessing pipeline.

public static TOutput Transform(TOutput output)

Parameters

output TOutput

The model output to postprocess.

Returns

TOutput

The postprocessed output, or the original output if no pipeline is configured.

Remarks

If no postprocessing pipeline has been configured, this method returns the output unchanged. This allows models to safely call this method without checking if postprocessing is configured.