Table of Contents

Interface IPipelineStep<T, TInput, TOutput>

Namespace
AiDotNet.Interfaces
Assembly
AiDotNet.dll

Represents a step in a data processing pipeline

public interface IPipelineStep<T, TInput, TOutput>

Type Parameters

T

The numeric type for computations

TInput

The input data type for pipeline operations

TOutput

The output data type for pipeline operations

Remarks

For Beginners: A pipeline step is a modular component that processes data in stages. Each step can fit (learn from data), transform (process data), or both. This pattern allows you to chain multiple processing steps together to create complex data processing workflows.

The generic parameters allow this interface to work with different types of data while maintaining type safety. T is typically a numeric type (like double or float) used for calculations, while TInput and TOutput define what types of data the step accepts and produces.

Methods

FitAsync(TInput, TOutput?)

Fits/trains this pipeline step on the provided data

Task FitAsync(TInput inputs, TOutput? targets = default)

Parameters

inputs TInput

Input data for training

targets TOutput

Target data for supervised learning (optional)

Returns

Task

Task representing the asynchronous operation

FitTransformAsync(TInput, TOutput?)

Fits and transforms in a single operation (convenience method)

Task<TOutput> FitTransformAsync(TInput inputs, TOutput? targets = default)

Parameters

inputs TInput

Input data

targets TOutput

Target data (optional)

Returns

Task<TOutput>

Transformed output data

GetMetadata()

Gets metadata about this pipeline step

Dictionary<string, string> GetMetadata()

Returns

Dictionary<string, string>

Metadata dictionary

GetParameters()

Gets the parameters of this pipeline step

Dictionary<string, object> GetParameters()

Returns

Dictionary<string, object>

Dictionary of parameter names and values

SetParameters(Dictionary<string, object>)

Sets the parameters of this pipeline step

void SetParameters(Dictionary<string, object> parameters)

Parameters

parameters Dictionary<string, object>

Dictionary of parameter names and values

TransformAsync(TInput)

Transforms the input data using the fitted model

Task<TOutput> TransformAsync(TInput inputs)

Parameters

inputs TInput

Input data to transform

Returns

Task<TOutput>

Transformed output data

ValidateInput(TInput)

Validates that this step can process the given input

bool ValidateInput(TInput inputs)

Parameters

inputs TInput

Input data to validate

Returns

bool

True if valid, false otherwise