SamplingHelper

Helpers & Utilities · AiDotNet.Helpers

Provides methods for sampling data, which is essential for many AI and machine learning techniques.

How It Works

For Beginners: Sampling is like picking random items from a collection. This is important in AI for creating training sets, validation sets, and implementing techniques like bootstrapping that help improve model accuracy and reliability.

Methods

Method Summary
List<T[]> CreateBootstrapSamples(T[] data, int numberOfSamples, int? sampleSize) Creates bootstrap samples from the given data, which are random samples with replacement used for estimating statistical properties.
int[] SampleWithReplacement(int populationSize, int sampleSize) Performs sampling with replacement, meaning the same item can be selected multiple times.
int[] SampleWithoutReplacement(int populationSize, int sampleSize) Performs sampling without replacement, meaning once an item is selected, it cannot be selected again.
void ClearSeed() Clears the seed and restores thread-safe random number generation.
void SetSeed(int seed) Sets the seed for the random number generator to ensure reproducible results.