Giter VIP home page Giter VIP logo

Comments (6)

CamDavidsonPilon avatar CamDavidsonPilon commented on August 22, 2024

Thanks for the detailed issue @pgr. I can confirm the error on my own machine.

Interestingly, I just made an issue today that will resolve this: #4. The problem is the data is in sorted order.

import random
random.shuffle(problem_data)

td = tdigest.TDigest()
td.batch_update(problem_data)

works fine. I'll add this as an additional constraint/problem to be addressed in #4.

from tdigest.

CamDavidsonPilon avatar CamDavidsonPilon commented on August 22, 2024

Oh wait, I was wrong; the data is not sorted. Strange then that the shuffle solves the issue...

from tdigest.

CamDavidsonPilon avatar CamDavidsonPilon commented on August 22, 2024

I can narrow it down to just this data: https://gist.github.com/CamDavidsonPilon/2357b9d1b2d1401640fc

from tdigest.

CamDavidsonPilon avatar CamDavidsonPilon commented on August 22, 2024

K got it. It was because I was using an unbalanced binary tree in bintrees: https://github.com/CamDavidsonPilon/tdigest/blob/master/tdigest/tdigest.py#L4

If ordered data was passed in, as it was in both our examples (a subset in yours), then the tree becomes very lopsided. When we try to call iter_items on the tree, we hit the upper limit of 64 depth (hardcoded in bintrees as MAXSTACK). You can see the calls here: https://searchcode.com/codesearch/view/55567668/

Solution is the change to FastRBTree in bintrees. I tested this and it works on our data. Only downside is is that it will be slightly slower. I feel this is a fair tradeoff.

from tdigest.

CamDavidsonPilon avatar CamDavidsonPilon commented on August 22, 2024

Fixed in latest commit!

from tdigest.

pgr avatar pgr commented on August 22, 2024

Confirmed, cheers!.

from tdigest.

Related Issues (20)

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.