Algorithm::HyperLogLog - Implementation of the HyperLogLog algorithm
use Algorithm::HyperLogLog; my $hll = Algorithm::HyperLogLog->new(14); while(<>){ $hll->add($_); } my $cardinality = $hll->estimate();
This module is implementation of the HyperLogLog algorithm.
HyperLogLog is an algorithm for estimating the cardinality of a set.
Constructor.
`$b` is the parameter for determining register size. (The register size is 2^$b.)
`$b` must be a integer between 4 and 16.
Adds element to the cardinality estimator.
Returns estimated cardinality value in floation point number.
If using XS backend, this method return true value.
Philippe Flajolet, Éric Fusy, Olivier Gandouet and Frédéric Meunier. HyperLogLog: the analysis of a near-optimal cardinality estimation algorithm. 2007 Conference on Analysis of Algorithms, DMTCS proc. AH, pp. 127–146, 2007. http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf
Hideaki Ohno <hide.o.j55 {at} gmail.com>
MurmurHash3(https://github.com/PeterScott/murmur3)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Algorithm::HyperLogLog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::HyperLogLog
CPAN shell
perl -MCPAN -e shell install Algorithm::HyperLogLog
For more information on module installation, please visit the detailed CPAN module installation guide.