Handbook
Glossary
balance-labels ( X y n -- X' y' )
Vocabulary
machine-learning
.
rebalancing
Inputs
X
an
object
y
an
object
n
an
object
Outputs
X'
an
object
y'
an
object
Definition
USING:
arrays
assocs
kernel
sequences
;
IN:
machine-learning.rebalancing
:
balance-labels
( X y n -- X' y' )
[
dup
collect-indices
values
[
equal-stratified-sample
[
swap
nth
]
curry
bi@
2array
]
3curry
]
dip
swap
replicate
[
keys
]
[
values
]
bi
;