Like sos2U but no underflows are reported.
Like sos2U but no underflows are reported. Instead the values are first clamped to be in range so in the event value < min, return a tuple representing the min.
number to be sos2 binned
minimum bin value
minimum bin value
bin size
sos2 binned value
See com.eharmony.aloha.feature.Sos2.
number to be sos2 binned
minimum bin value
minimum bin value
bin size
When value < min, an underflow key-value pair is emitted. This controls the key that is emitted.
When value is missing, a separate key-value pair is emitted. This controls the key that is emitted.
sos2 binned value
This is the purest form of sos2 binning that clamps the values in the [min, max] interval and then bins.
This is the purest form of sos2 binning that clamps the values in the [min, max] interval and then bins.
scala> (0 to 10).map(_ / 4.0 - 0.25).map(v => s"$v\t${sos2(v, 0, 2, 1)}").foreach(println) -0.25 List((0,1.0)) 0.0 List((0,1.0)) 0.25 List((0,0.75), (1,0.25)) 0.5 List((0,0.5), (1,0.5)) 0.75 List((0,0.25), (1,0.75)) 1.0 List((1,1.0)) 1.25 List((1,0.75), (2,0.25)) 1.5 List((1,0.5), (2,0.5)) 1.75 List((1,0.25), (2,0.75)) 2.0 List((2,1.0)) 2.25 List((2,1.0))
number to be sos2 binned
minimum bin value
minimum bin value
bin size
sos2 binned value
number to be sos2 binned
minimum bin value
minimum bin value
bin size
When value < min, an underflow key-value pair is emitted. This controls the key that is emitted.
When value is missing (None), a separate key-value pair is emitted. This controls the pair(s) that is/are emitted.
scala> (0 to 10).map(_ / 4.0 - 0.25).map(v => s"$v\t${sos2U(v, 0, 2, 1)}").foreach(println) -0.25 List((=UNDERFLOW,1.0)) 0.0 List((=0,1.0)) 0.25 List((=0,0.75), (=1,0.25)) 0.5 List((=0,0.5), (=1,0.5)) 0.75 List((=0,0.25), (=1,0.75)) 1.0 List((=1,1.0)) 1.25 List((=1,0.75), (=2,0.25)) 1.5 List((=1,0.5), (=2,0.5)) 1.75 List((=1,0.25), (=2,0.75)) 2.0 List((=2,1.0)) 2.25 List((=2,1.0))
number to be sos2 binned
minimum bin value
minimum bin value
bin size
sos2 binned value
Sos2 takes a value and breaks it apart into a linear combination of the two closest values as specified by the min, max, and delta. As long as the value being sos2 binned exists in the interval [min, max], then there exists an isomorphism between the value and the sos2 binned value.