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
TThe numeric type for computations
TInputThe input data type for pipeline operations
TOutputThe 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
inputsTInputInput data for training
targetsTOutputTarget 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
inputsTInputInput data
targetsTOutputTarget 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
parametersDictionary<string, object>Dictionary of parameter names and values
TransformAsync(TInput)
Transforms the input data using the fitted model
Task<TOutput> TransformAsync(TInput inputs)
Parameters
inputsTInputInput 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
inputsTInputInput data to validate
Returns
- bool
True if valid, false otherwise