truemped / streamingds

A set of streaming data structures for python
MIT License
0 stars 1 forks source link

HyperLogLog test instable #8

Open truemped opened 8 years ago

truemped commented 8 years ago

The unittest for the hyperloglog is instable and fails every now and then with this error:

___________________________ test_simple_hyperloglog ____________________________

    def test_simple_hyperloglog():
        hll = HyperLogLog(12)

        num_elements = 500000

        elements = sample(xrange(5000000), num_elements)
        hll.add(*elements)

        cardinality = hll.cardinality()

        margin = cardinality * hll.error_rate
>       assert num_elements - margin <= cardinality <= num_elements + margin
E       assert 514735.0607839002 <= (500000 + 8364.444737738379)

tests/test_hyperloglog.py:19: AssertionError

@mliesenberg any ideas?

mliesenberg commented 8 years ago

it's basically telling us that it missed the theoretical error bounds.

I will look into it.

truemped commented 8 years ago

Ping :)