BatchConfigurationBuilder<TBatch>

Helpers & Utilities · AiDotNet.Extensions

Builder for configuring batch iteration with a fluent API.

Implements: IEnumerable<TBatch>

How It Works

This builder allows chaining configuration methods before iteration. Implements IEnumerable to support foreach loops and LINQ operations.

Constructors

Constructor Summary
BatchConfigurationBuilder(IBatchIterable<TBatch> source, int? batchSize) Initializes a new instance of the BatchConfigurationBuilder.

Methods

Method Summary
BatchConfigurationBuilder<TBatch> DropLast() Drops the last incomplete batch if the dataset doesn’t divide evenly.
BatchConfigurationBuilder<TBatch> KeepLast() Keeps the last batch even if incomplete.
BatchConfigurationBuilder<TBatch> NoShuffle() Disables shuffling of data before batching.
BatchConfigurationBuilder<TBatch> Shuffled() Enables shuffling of data before batching.
BatchConfigurationBuilder<TBatch> WithSeed(int seed) Sets a random seed for reproducible shuffling.
IEnumerator<TBatch> GetEnumerator() Returns an enumerator that iterates through the batches.