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

Function TestMinMaxNormalizedCategoricalEncoder

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

Source from the content-addressed store, hash-verified

183}
184
185func TestMinMaxNormalizedCategoricalEncoder(t *testing.T) {
186 var encoder = NewValueEncoder()
187 encoder.conf = &Config{
188 MinMax: true,
189 NormalizeCategoricals: true,
190 }
191
192 var res []string
193 for _, val := range categoricalTest {
194 res = append(res, encoder.String("proto", val))
195 }
196
197 assert.Equal(t, res, []string{"0.0000000000", "1.0000000000", "1.0000000000", "1.0000000000", "0.0000000000", "0.3333333333", "0.6666666667", "1.0000000000"}, "unexpected output")
198}

Callers

nothing calls this directly

Calls 2

NewValueEncoderFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected