midas_python 0.2.1

Python bindings to the Rust lib port of MIDAS (Microcluster-Based Detector of Anomalies in Edge Streams)
Documentation
from midas import (
    MidasR,
    hash,
)
import csv

if __name__ == "__main__":
    midas = MidasR()
    with open("in.csv") as infile, open("test.out.csv", "w") as outfile:
        reader = csv.reader(infile)
        writer = csv.writer(outfile)
        for line in reader:
            source = hash(line[0])
            dest = hash(line[1])
            time = int(line[2])
            writer.writerow([
                line[0],
                line[1],
                time,
                "{:.6f}".format(midas.insert(source, dest, time)),
            ])