Giter VIP home page Giter VIP logo

tdigest's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tdigest's Issues

Crash on quantile() of merged TDigest after compress()

The following test case reproduces the problem:

TEST_F(TDigestTest, CrashAfterMerge) {
  tdigest::TDigest digest(1000);
  std::uniform_real_distribution<> reals(0.0, 1.0);
  std::random_device gen;
  for (int i = 0; i < 100000; i++) {
    digest.add(reals(gen));
  }
  digest.compress();

  tdigest::TDigest digest2(1000);
  digest2.merge(&digest);
  digest2.quantile(0.5);
}

From my debugging, it seems the crash happens in line 338, because the cumulative_ structure is empty after the merge. Adding a call to updateCumulative() at the end of merge() fixes the crash.

Some background: I was using your implementation in a distributed setting, were partial results are serialized, and sent to a central node, where they are deserialized and merged into one result. The above test case simulates this and also triggers the crash (so the serialization is not the problem). Maybe the call to compress() is just wrong, but it instinctively seemed correct to compress before serialization ;-)

License?

Would it be possible to choose a license for this project and add a LICENSE file?

How do I use this library?

Hi!
I would like to compute quantiles for data of mine and stumbled over this. I browsed through the code but have really no idea, how I can compute quantiles. Would you have a quick guide, what functions to call or classes to instantiate to get a number of quantiles from a data set?

Upstream Java t-digest has some interesting new code

I don't know if you want anything we have in the Java code, but this is a tickler to have a look.

I just found some insidious issues relative to repeated counts that you may care about. If you have a stable sort, these may not have impacted you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.