Table of Contents

Class SequentialSampler

Namespace
AiDotNet.Data.Sampling
Assembly
AiDotNet.dll

A sampler that returns indices in sequential order without shuffling.

public class SequentialSampler : DataSamplerBase, IDataSampler
Inheritance
SequentialSampler
Implements
Inherited Members

Remarks

SequentialSampler is useful during evaluation/inference when you want deterministic, reproducible results without any randomness.

For Beginners: This sampler goes through your data in order (0, 1, 2, 3, ...). Use this when: - Evaluating your model (you want consistent results) - Making predictions on new data - Debugging to isolate issues from randomness

Constructors

SequentialSampler(int)

Initializes a new instance of the SequentialSampler class.

public SequentialSampler(int datasetSize)

Parameters

datasetSize int

The total number of samples in the dataset.

Exceptions

ArgumentOutOfRangeException

Thrown when datasetSize is less than 1.

Properties

Length

Gets the total number of samples this sampler will produce per epoch.

public override int Length { get; }

Property Value

int

Remarks

This may differ from the dataset size for oversampling or undersampling strategies.

Methods

GetIndicesCore()

Core implementation for generating indices. Override this in derived classes.

protected override IEnumerable<int> GetIndicesCore()

Returns

IEnumerable<int>

An enumerable of sample indices.