CardinalityEstimation.Signed 1.11.0

.NET 6.0 .NET Core 3.1 .NET Standard 2.0
Install-Package CardinalityEstimation.Signed -Version 1.11.0
dotnet add package CardinalityEstimation.Signed --version 1.11.0
<PackageReference Include="CardinalityEstimation.Signed" Version="1.11.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CardinalityEstimation.Signed --version 1.11.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CardinalityEstimation.Signed, 1.11.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install CardinalityEstimation.Signed as a Cake Addin
#addin nuget:?package=CardinalityEstimation.Signed&version=1.11.0

// Install CardinalityEstimation.Signed as a Cake Tool
#tool nuget:?package=CardinalityEstimation.Signed&version=1.11.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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:

  1. 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
  2. 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

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
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.11.0 56 6/26/2022
1.10.0 293 2/1/2021
1.9.0 318 11/18/2020
1.6.0 1,873 10/23/2017

Remove usage of LINQ (#37)
           Cosmetic changes (#36)
           Changed Add to return bool (#33)
           Less sensitive UTs (#35)
           Add copy CTOR to CardinalityEstimator and implement IEquatable (#34)