Overview
This issue tracks the implementation of VarOptItemsSketch (Variance Optimal Sampling) for the Go library, following the Java and C++ implementations.
VarOpt provides weighted sampling with optimal variance for subset sum estimation - useful for network traffic monitoring, ad analytics, and log sampling.
Proposed Implementation Plan
We plan to split this into multiple PRs for easier review:
PR 1: Core VarOptItemsSketch (basic functionality)
PR 2: Serialization & Compatibility
PR 3: Subset Sum Estimation
PR 4: VarOptItemsUnion (optional, can be deferred)
References
Overview
This issue tracks the implementation of
VarOptItemsSketch(Variance Optimal Sampling) for the Go library, following the Java and C++ implementations.VarOpt provides weighted sampling with optimal variance for subset sum estimation - useful for network traffic monitoring, ad analytics, and log sampling.
Proposed Implementation Plan
We plan to split this into multiple PRs for easier review:
PR 1: Core VarOptItemsSketch (basic functionality)
VarOptItemsfamily (ID=13) tointernal/family.goVarOptItemsSketch[T]struct with fields: k, n, h, m, r, totalWtR, data, weightsPR 2: Serialization & Compatibility
encodeVarOptItemsSketch+VarOptItemsSketchEncoder.Encode())NewVarOptItemsSketchFromSlice()PR 3: Subset Sum Estimation
EstimateSubsetSum(predicate)returning boundsPR 4: VarOptItemsUnion (optional, can be deferred)
References
VarOptItemsSketch.javavar_opt_sketch.hpp