Documentation ¶
Index ¶
- Variables
- func AddData(data []float64, hists ...tdigest.Sketch)
- func CombineOptions(options ...[]Option) [][]Option
- type AccuracyTest
- type Option
- func Constructor(f func() tdigest.Sketch) Option
- func Constructors(name string, f func(o ...tdigest.Option) tdigest.Sketch, ...) []Option
- func Distribution(name string, sample func() float64) Option
- func N(n int) Option
- func Name(n string) Option
- func Options(o ...Option) Option
- func Order(name string, orderFunc func([]float64)) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Distributions is a useful set of distributions for accuracy testing. Distributions = []Option{ Distribution("Uniform", rand.Float64), Distribution("Normal", rand.NormFloat64), Distribution("Exponential", rand.ExpFloat64), } // Orders is a set of data orders to insert into a sketch. Orders = []Option{ Order("ascending", sort.Float64s), Order("descending", func(data []float64) { sort.Slice(data, func(i, j int) bool { return data[i] > data[j] }) }), Order("shuffled", func(data []float64) { rand.Shuffle(len(data), func(i, j int) { data[i], data[j] = data[j], data[i] }) }), } )
Functions ¶
func CombineOptions ¶
CombineOptions makes a cartesian product of options
Types ¶
type AccuracyTest ¶
type AccuracyTest struct {
// contains filtered or unexported fields
}
AccuracyTest tests the accuracy of a sketch given a distribution.
func MakeTests ¶
func MakeTests(testOptions ...[]Option) []AccuracyTest
MakeTests makes a slice of tests where each test has been configured with the passed slice of options.
func (*AccuracyTest) Run ¶
func (at *AccuracyTest) Run(t testing.TB)
func (*AccuracyTest) String ¶
func (at *AccuracyTest) String() string
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func Constructor ¶
func Constructors ¶
func Distribution ¶
Click to show internal directories.
Click to hide internal directories.