CardinalityEstimation.Signed
1.14.0
dotnet add package CardinalityEstimation.Signed --version 1.14.0
NuGet\Install-Package CardinalityEstimation.Signed -Version 1.14.0
<PackageReference Include="CardinalityEstimation.Signed" Version="1.14.0" />
<PackageVersion Include="CardinalityEstimation.Signed" Version="1.14.0" />
<PackageReference Include="CardinalityEstimation.Signed" />
paket add CardinalityEstimation.Signed --version 1.14.0
#r "nuget: CardinalityEstimation.Signed, 1.14.0"
#:package CardinalityEstimation.Signed@1.14.0
#addin nuget:?package=CardinalityEstimation.Signed&version=1.14.0
#tool nuget:?package=CardinalityEstimation.Signed&version=1.14.0
CardinalityEstimation
HyperLogLog-based set cardinality estimation library
This library estimates the number of unique elements in a set, in a quick and memory-efficient manner. It's based on the following:
- Flajolet et al., "HyperLogLog: the analysis of a near-optimal cardinality estimation algorithm", DMTCS proc. AH 2007, http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf
- Heule, Nunkesser and Hall 2013, "HyperLogLog in Practice: Algorithmic Engineering of a State of The Art Cardinality Estimation Algorithm", http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/pubs/archive/40671.pdf
The accuracy/memory usage are user-selectable. Typically, a cardinality estimator will give a perfect estimate of small cardinalities (up to 100 unique elements), and 97% accuracy or better (usually much better) for any cardinality up to near 2^64, while consuming several KB of memory (no more than 16KB).
Usage
Usage is very simple:
ICardinalityEstimator<string> estimator = new CardinalityEstimator();
estimator.Add("Alice");
estimator.Add("Bob");
estimator.Add("Alice");
estimator.Add("George Michael");
ulong numberOfuniqueElements = estimator.Count(); // will be 3
Nuget Package
This code is available as the Nuget package CardinalityEstimation.
To install, run the following command in the Package Manager Console:
Install-Package CardinalityEstimation
Release Notes
Keeping things friendly
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- murmurhash-signed (>= 1.0.3)
- System.IO.Hashing (>= 8.0.0)
-
net9.0
- murmurhash-signed (>= 1.0.3)
- System.IO.Hashing (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added support for Span/ReadOnlySpan/Memory/ReadOnlyMemory
Added ConcurrentCardinalityEstimator
Updated XML docs