extra: using "swap index".
parent
3d86fba48b
commit
761be328a6
|
@ -58,7 +58,7 @@ ERROR: undefined-find-nth m n seq quot ;
|
|||
>lower '[ name>> _ = ] find ; inline
|
||||
|
||||
: stack-find ( seq quot: ( elt -- 1/0/-1 ) -- i/f )
|
||||
map cum-sum [ 0 = ] find drop ; inline
|
||||
map cum-sum 0 swap index ; inline
|
||||
|
||||
: tag-classifier ( string -- quot )
|
||||
>lower
|
||||
|
|
|
@ -18,6 +18,4 @@ M: label-binarizer transform-y
|
|||
] map ;
|
||||
|
||||
M: label-binarizer inverse-transform-y
|
||||
classes_>> '[
|
||||
[ 1 = ] find drop _ nth
|
||||
] map ;
|
||||
classes_>> '[ 1 swap index _ nth ] map ;
|
||||
|
|
Loading…
Reference in New Issue