MCPcopy Index your code
hub / github.com/dreadl0ck/netcap / TestNumericZscoreEncoder

Function TestNumericZscoreEncoder

encoder/encoder_test.go:83–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81var numericTestFloat = []float64{5, 2, 6, 5, 2, 6}
82
83func TestNumericZscoreEncoder(t *testing.T) {
84 var encoder = NewValueEncoder()
85 encoder.conf = &Config{
86 ZScore: true,
87 }
88
89 var res []string
90 for _, val := range numericTest {
91 res = append(res, encoder.Int("bytes", val))
92 }
93
94 assert.Equal(t, res, []string{"0.7071067812", "-0.7071067812", "0.7071067812", "0.7071067812", "-0.7071067812", "0.7071067812"}, "unexpected output")
95}
96
97func TestZscoreAllData(t *testing.T) {
98

Callers

nothing calls this directly

Calls 2

NewValueEncoderFunction · 0.85
IntMethod · 0.80

Tested by

no test coverage detected