LabelMulti
struct
defined in module
FastAI
LabelMulti(classes)
setup(LabelMulti, data)
Block
for a categorical label in a multi-class context.
data
is valid for
Label(classes)
if
data ∈ classes
.
block
=
Label
(
[
"
cat
"
,
"
dog
"
]
)
# an observation can be either "cat" or "dog"
@
test
FastAI
.
checkblock
(
block
,
"
cat
"
)
@
test
!
(
FastAI
.
checkblock
(
block
,
"
horsey
"
)
)
You can use
setup
to create a
Label
instance from a data container containing possible classes:
targets
=
[
"
cat
"
,
"
dog
"
,
"
dog
"
,
"
dog
"
,
"
cat
"
,
"
dog
"
]
block
=
setup
(
Label
,
targets
)
@
test
block
≈
Label
(
[
"
cat
"
,
"
dog
"
]
)
There is
1
method for FastAI.LabelMulti
:
The following pages link back here:
New visualization tools for FastAI.jl
FastAI.jl , blocks/label.jl , encodings/onehot.jl , interpretation/text.jl , FastTabular.jl , FastVision.jl , recipes.jl , tasks/classification.jl