Run NodesReferenceutils

sampler

Package sampler

import "github.com/luxfi/node/utils/sampler"

Types

Source

Uniform

Uniform samples values without replacement in the provided range

func NewBestUniform(expectedSampleSize int) Uniform
func NewDeterministicUniform(source Source) Uniform
func NewUniform() Uniform

Weighted

Weighted defines how to sample a specified valued based on a provided weighted distribution

func NewWeighted() Weighted

WeightedWithoutReplacement

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 NewDeterministicWeightedWithoutReplacement(source Source) WeightedWithoutReplacement
func NewWeightedWithoutReplacement() WeightedWithoutReplacement