datalib-sketch icon indicating copy to clipboard operation
datalib-sketch copied to clipboard

Deserialization bug for t-digest

Open rupnikj opened this issue 7 years ago • 1 comments

var d = require('datalib-sketch');
var t = new d.TDigest(100);
t.add(10);
t.add(20);
t.add(30);
console.log(t.quantile(0.5)); // outputs 20
var t2 = d.TDigest.import(t.export());
console.log(t2.quantile(0.5)); // outputs Infinity

rupnikj avatar May 13 '17 10:05 rupnikj

PR #5 saves and restores the whole state

rupnikj avatar May 13 '17 11:05 rupnikj