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.

Examples


			
			
			
			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
			"
			]
			)