Skip to content

Conversation

@e10e3
Copy link
Contributor

@e10e3 e10e3 commented May 31, 2025

NUnique does not adhere to the univariate statistic abstract class API; its update() method does not have a number as an input but a string1.

The functionality of NUnique, with its probabilistic properties (it has an error rate), better fits the goals of the sketch module. As a matter of fact, the HyperLogLog algorithm it implements is commonly described as a sketch (or a “probabilistic data structure”), the same way as the Bloom filter or the Count-Min sketch.

This PR moves the NUnique class to the sketch module.

I added type hints to the file while I was at it.

By the way, this is quite a breaking change, what is River's stability policy?

Footnotes

  1. The _hash() method only accepts a string, the update() method does the same transitively. Try giving it a number as its argument.

e10e3 added 6 commits October 7, 2025 22:45
NUnique does not adhere to the Statistic API; its update() method does
not have a floating-point number as an input.

The functionality of NUnique, with its probabilistic properties, better
fits the goals of the sketch module.
@e10e3 e10e3 force-pushed the move-nunique-to-sketch branch from 6904867 to bab9976 Compare October 7, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant