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