vivienm / rust-tdigest-ch

A Rust library for estimating quantiles in a stream, using ClickHouse t-digest data structure.

Home Page:https://vivienm.github.io/rust-tdigest-ch/docs/tdigest_ch/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tdigest-ch

A Rust library for estimating quantiles in a stream, using ClickHouse t-digest data structure.

The t-digest data structure is designed around computing accurate quantile estimates from streaming data. Two t-digests can be merged, making the data structure well suited for map-reduce settings.

Documentation

Example

use tdigest_ch::TDigest;

let mut digest = TDigest::new();

// Add some elements.
digest.insert(1.0);
digest.insert(2.0);
digest.insert(3.0);

// Get the median of the distribution.
let quantile = digest.quantile(0.5);
assert_eq!(quantile, 2.0);

About

A Rust library for estimating quantiles in a stream, using ClickHouse t-digest data structure.

https://vivienm.github.io/rust-tdigest-ch/docs/tdigest_ch/

License:MIT License


Languages

Language:Rust 98.7%Language:Just 1.3%