This is an automated email from the ASF dual-hosted git repository.

placave pushed a commit to branch go-characterization
in repository 
https://gitbox.apache.org/repos/asf/datasketches-characterization.git


The following commit(s) were added to refs/heads/go-characterization by this 
push:
     new de09987  [Go] Add test runner and use float64 KLL in accuracy stats
de09987 is described below

commit de099870dcc403872f8d15f80f293ec6591d6d21
Author: Pierre Lacave <[email protected]>
AuthorDate: Tue Mar 19 19:50:08 2024 +0100

    [Go] Add test runner and use float64 KLL in accuracy stats
---
 go/distinct_count_accuracy_profile.go |  6 +++---
 go/go.mod                             |  2 +-
 go/go.sum                             |  2 ++
 go/main_test.go                       | 10 ++++++++++
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/go/distinct_count_accuracy_profile.go 
b/go/distinct_count_accuracy_profile.go
index f399731..ac54f94 100644
--- a/go/distinct_count_accuracy_profile.go
+++ b/go/distinct_count_accuracy_profile.go
@@ -52,7 +52,7 @@ type accuracyStats struct {
        sumSqRelErr float64
        count       int
        // Make that a sketch of float64
-       rel_err_distribution *kll.ItemsSketch[int64]
+       rel_err_distribution *kll.ItemsSketch[float64]
 }
 
 func (a *accuracyStats) update(est float64) {
@@ -60,7 +60,7 @@ func (a *accuracyStats) update(est float64) {
        relativeError := est/float64(a.trueValue) - 1.0
        a.sumRelErr += relativeError
        a.sumSqRelErr += relativeError * relativeError
-       a.rel_err_distribution.Update(int64(relativeError))
+       a.rel_err_distribution.Update(relativeError)
        a.count++
 }
 
@@ -221,7 +221,7 @@ func buildLog2AccuracyStatsArray(lgMin, lgMax, ppo, lgQK 
int) []*accuracyStats {
        qArr := make([]*accuracyStats, qLen)
        p := uint64(1) << lgMin
        for i := 0; i < qLen; i++ {
-               kllSketch, _ := kll.NewKllItemsSketch[int64](uint16(lgQK), 8, 
common.ArrayOfLongsSerDe{})
+               kllSketch, _ := kll.NewKllItemsSketch[float64](uint16(lgQK), 8, 
common.ArrayOfDoublesSerDe{})
                qArr[i] = &accuracyStats{
                        trueValue:            p,
                        rel_err_distribution: kllSketch,
diff --git a/go/go.mod b/go/go.mod
index b820dce..85db448 100644
--- a/go/go.mod
+++ b/go/go.mod
@@ -18,6 +18,6 @@ module github.com/apache/datasketches-characterization/go
 
 go 1.21.1
 
-require github.com/apache/datasketches-go v0.0.0-20240312184136-6950b3ed5d9c
+require github.com/apache/datasketches-go v0.0.0-20240319101001-9f08c628cc66
 
 require github.com/twmb/murmur3 v1.1.8 // indirect
diff --git a/go/go.sum b/go/go.sum
index 9fb48d3..72fab08 100644
--- a/go/go.sum
+++ b/go/go.sum
@@ -1,5 +1,7 @@
 github.com/apache/datasketches-go v0.0.0-20240312184136-6950b3ed5d9c 
h1:wa6C87Gc0UOTCXYSyEQCZKbdzBKA7x+Wk1pLjPRvCj4=
 github.com/apache/datasketches-go v0.0.0-20240312184136-6950b3ed5d9c/go.mod 
h1:MieYfErTcRk22fstMEpxXk0/bzFfSbnfE/Kxz6tLvCE=
+github.com/apache/datasketches-go v0.0.0-20240319101001-9f08c628cc66 
h1:D1waSfcR2fuDfd5leic6q88xYyX+q9spGh7lfdSv11s=
+github.com/apache/datasketches-go v0.0.0-20240319101001-9f08c628cc66/go.mod 
h1:MieYfErTcRk22fstMEpxXk0/bzFfSbnfE/Kxz6tLvCE=
 github.com/davecgh/go-spew v1.1.1 
h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod 
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/pmezard/go-difflib v1.0.0 
h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
diff --git a/go/main_test.go b/go/main_test.go
new file mode 100644
index 0000000..6dd41e5
--- /dev/null
+++ b/go/main_test.go
@@ -0,0 +1,10 @@
+package main
+
+import (
+       "testing"
+)
+
+func TestHllSketchAccuracyRunner(t *testing.T) {
+       runner := NewDistinctCountAccuracyProfile(distinctCountJobConfig)
+       runner.run()
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to