#count-min-sketch #clustering #streaming #midas

midas_rs

Rust lib port of MIDAS (Microcluster-Based Detector of Anomalies in Edge Streams)

6 releases

0.2.1 Mar 11, 2020
0.2.0 Mar 11, 2020
0.1.3 Mar 8, 2020

#4 in #count-min-sketch


Used in 2 crates

MIT/Apache

17KB
339 lines

midas_rs

Documentation

Rust implementation of https://github.com/bhatiasiddharth/MIDAS

# Cargo.toml
[dependencies]
midas_rs = "0.2"
use midas_rs::{Int, Float, MidasR};

fn main() {
    // For configuration options, refer to MidasRParams
    let mut midas = MidasR::new(Default::default());

    println!("{:.6}", midas.insert((1, 1, 1)));
    println!("{:.6}", midas.insert((1, 2, 1)));
    println!("{:.6}", midas.insert((1, 1, 2)));
    println!("{:.6}", midas.insert((1, 2, 3)));

    assert_eq!(midas.insert((1, 2, 4)), midas.query(1, 2));
}

lib.rs:

Rust implementation of https://github.com/bhatiasiddharth/MIDAS

use midas_rs::{Int, Float, MidasR};

fn main() {
    // For configuration options, refer to MidasRParams
    let mut midas = MidasR::new(Default::default());

    println!("{:.6}", midas.insert((1, 1, 1)));
    println!("{:.6}", midas.insert((1, 2, 1)));
    println!("{:.6}", midas.insert((1, 1, 2)));
    println!("{:.6}", midas.insert((1, 2, 3)));

    assert_eq!(midas.insert((1, 2, 4)), midas.query(1, 2));
}

Dependencies

~550KB
~10K SLoC