Skip to main content

CardinalitySketch

Trait CardinalitySketch 

Source
pub trait CardinalitySketch: Sketch {
    // Required methods
    fn estimate(&self) -> f64;
    fn error_bounds(&self, confidence: f64) -> ErrorBounds;
    fn relative_error(&self) -> f64;

    // Provided method
    fn estimate_with_bounds(&self) -> ErrorBounds { ... }
}
Expand description

Cardinality (distinct count) estimation sketches

Required Methods§

Source

fn estimate(&self) -> f64

Estimate number of distinct items seen

Source

fn error_bounds(&self, confidence: f64) -> ErrorBounds

Get error bounds at given confidence level (0.0 to 1.0)

Source

fn relative_error(&self) -> f64

Relative standard error (RSE) of the estimate

RSE = standard_error / true_value ≈ 1.04 / sqrt(m) for HLL

Provided Methods§

Source

fn estimate_with_bounds(&self) -> ErrorBounds

Estimate with default 95% confidence bounds

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl CardinalitySketch for HyperLogLog

Available on crate feature cardinality only.