Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Uniform ¶
type Uniform interface { Initialize(sampleRange uint64) error Sample(length int) ([]uint64, error) Reset() Next() (uint64, error) }
Uniform samples values without replacement in the provided range
func NewBestUniform ¶
NewBestUniform returns a new sampler
type Weighted ¶
type Weighted interface { Initialize(weights []uint64) error Sample(sampleValue uint64) (int, error) }
Weighted defines how to sample a specified valued based on a provided weighted distribution
type WeightedWithoutReplacement ¶
type WeightedWithoutReplacement interface { Initialize(weights []uint64) error Sample(count int) ([]int, error) }
WeightedWithoutReplacement defines how to sample weight without replacement. Note that the behavior is to sample the weight without replacement, not the indices. So duplicate indices can be returned.
func NewBestWeightedWithoutReplacement ¶
func NewBestWeightedWithoutReplacement( expectedSampleSize int, ) WeightedWithoutReplacement
NewBestWeightedWithoutReplacement returns a new sampler
func NewWeightedWithoutReplacement ¶
func NewWeightedWithoutReplacement() WeightedWithoutReplacement
NewWeightedWithoutReplacement returns a new sampler
Click to show internal directories.
Click to hide internal directories.