From 78009c91ba532361137906c54e12ce5a1a0615b4 Mon Sep 17 00:00:00 2001 From: Franklin Moormann Date: Fri, 17 Oct 2025 11:36:37 -0400 Subject: [PATCH 1/2] Fix IPipelineStep generic type definitions (US-BF-001) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add IPipelineStep interface with correct generic type parameters - Define interface with T, TInput, and TOutput generic parameters - Implement comprehensive XML documentation following project standards - Include beginner-friendly explanations in remarks sections This resolves compilation errors by properly defining TInput and TOutput as generic parameters at the interface level. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/Interfaces/IPipelineStep.cs | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/Interfaces/IPipelineStep.cs diff --git a/src/Interfaces/IPipelineStep.cs b/src/Interfaces/IPipelineStep.cs new file mode 100644 index 0000000000..f11522eff0 --- /dev/null +++ b/src/Interfaces/IPipelineStep.cs @@ -0,0 +1,71 @@ +using AiDotNet.LinearAlgebra; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace AiDotNet.Interfaces +{ + /// + /// Represents a step in a data processing pipeline + /// + /// The numeric type for computations + /// The input data type for pipeline operations + /// The output data type for pipeline operations + /// + /// 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. + /// + public interface IPipelineStep + { + /// + /// Fits/trains this pipeline step on the provided data + /// + /// Input data for training + /// Target data for supervised learning (optional) + /// Task representing the asynchronous operation + Task FitAsync(TInput inputs, TInput? targets = default); + + /// + /// Transforms the input data using the fitted model + /// + /// Input data to transform + /// Transformed output data + Task TransformAsync(TInput inputs); + + /// + /// Fits and transforms in a single operation (convenience method) + /// + /// Input data + /// Target data (optional) + /// Transformed output data + Task FitTransformAsync(TInput inputs, TInput? targets = default); + + /// + /// Gets the parameters of this pipeline step + /// + /// Dictionary of parameter names and values + Dictionary GetParameters(); + + /// + /// Sets the parameters of this pipeline step + /// + /// Dictionary of parameter names and values + void SetParameters(Dictionary parameters); + + /// + /// Validates that this step can process the given input + /// + /// Input data to validate + /// True if valid, false otherwise + bool ValidateInput(TInput inputs); + + /// + /// Gets metadata about this pipeline step + /// + /// Metadata dictionary + Dictionary GetMetadata(); + } +} From 41112ff7e11d992505e0df468f593b965472b6df Mon Sep 17 00:00:00 2001 From: Franklin Moormann Date: Fri, 17 Oct 2025 16:03:46 -0400 Subject: [PATCH 2/2] Fix Copilot review comments for PR #104 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change targets parameter type from TInput to TOutput in FitAsync method - Change targets parameter type from TInput to TOutput in FitTransformAsync method - This correctly represents supervised learning scenarios where targets are the expected output type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/Interfaces/IPipelineStep.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Interfaces/IPipelineStep.cs b/src/Interfaces/IPipelineStep.cs index f11522eff0..d325b63b66 100644 --- a/src/Interfaces/IPipelineStep.cs +++ b/src/Interfaces/IPipelineStep.cs @@ -26,7 +26,7 @@ public interface IPipelineStep /// Input data for training /// Target data for supervised learning (optional) /// Task representing the asynchronous operation - Task FitAsync(TInput inputs, TInput? targets = default); + Task FitAsync(TInput inputs, TOutput? targets = default); /// /// Transforms the input data using the fitted model @@ -41,7 +41,7 @@ public interface IPipelineStep /// Input data /// Target data (optional) /// Transformed output data - Task FitTransformAsync(TInput inputs, TInput? targets = default); + Task FitTransformAsync(TInput inputs, TOutput? targets = default); /// /// Gets the parameters of this pipeline step