Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
github.com/caio/go-tdigest
A fast map-reduce and parallel streaming friendly data-structure for accurate quantile approximation.
This package provides an implementation of Ted Dunning's t-digest data structure in Go.
This project is actively maintained. We are happy to collaborate on features and issues if/when they arrive.
Our releases are tagged and signed following the Semantic Versioning scheme. If you are using a dependency manager such as dep, the recommended way to is go about your business normally:
go get github.com/caio/go-tdigest
Otherwise we recommend to use the following so that you don't risk breaking your build because of an API change:
go get gopkg.in/caio/go-tdigest.v2
package main
import (
"fmt"
"math/rand"
"github.com/caio/go-tdigest"
)
func main() {
// Analogue to tdigest.New(tdigest.Compression(100))
t, _ := tdigest.New()
for i := 0; i < 10000; i++ {
// Analogue to t.AddWeighted(rand.Float64(), 1)
t.Add(rand.Float64())
}
fmt.Printf("p(.5) = %.6f\n", t.Quantile(0.5))
fmt.Printf("CDF(Quantile(.5)) = %.6f\n", t.CDF(t.Quantile(0.5)))
}
You can configure your digest upon creation with options documented at options.go. Example:
// Construct a digest with compression=200 and its own
// (thread-unsafe) RNG seeded with 0xCA10:
digest, _ := tdigest.New(
tdigest.Compression(200),
tdigest.LocalRandomNumberGenerator(0xCA10),
)
It's very easy to migrate to the new API:
tdigest.New(100)
with tdigest.New()
tdigest.New(number)
with tdigest.New(tdigest.Compression(number))
Add(x,1)
with Add(x)
Add(x, weight)
with AddWeighted(x, weight)
tdigest.Len()
(or open an issue)This is a port of the reference implementation with some ideas borrowed from the python version. If you wanna get a quick grasp of how it works and why it's useful, this video and companion article is pretty helpful.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.