Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tristanisham/f0
An implementation of the CVM algorithm for the distinct elements problem.
https://github.com/tristanisham/f0
cvm f0
Last synced: 3 months ago
JSON representation
An implementation of the CVM algorithm for the distinct elements problem.
- Host: GitHub
- URL: https://github.com/tristanisham/f0
- Owner: tristanisham
- License: mit
- Created: 2024-05-17T18:04:46.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-05-18T15:48:44.000Z (8 months ago)
- Last Synced: 2024-05-21T12:16:05.933Z (8 months ago)
- Topics: cvm, f0
- Language: Go
- Homepage: https://pkg.go.dev/github.com/tristanisham/f0
- Size: 1.33 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# f0
## An implementation of the CVM algorithm for the distinct elements (f0) problem.
This package implements the [CVM](https://arxiv.org/abs/2301.10191) algoritm in
pure Go. CVM is an algorithm for the distinct elements problem. When you're
trying to find the unique elements in a slice, but the slice exceeds the amount
of available memory, use f0 to estimate the number of unique elements in said
slice.```go
f0.Estimate(mySlice, 0.01, 0.001) // 329.4221234
```### More Reading
- [Computer Scientists Invent an Efficient New Way to Count](https://www.quantamagazine.org/computer-scientists-invent-an-efficient-new-way-to-count-20240516/)
## Contributing
I **NEED** tests. The problem with this algorithm is that I need large sets of
comparable elements to test f0 on. Currently (below v1), there is no guarentee
the algorithm will work correctly. After we've developed a large and robust test
suite and can establish the algorithm is behaving as expected, this library will
be promoted to v1 and maintained.The Bible is included for testing purposes. There's no copyright in the Kingdom of Heaven.