Processor for binary classification labels. Supports numeric (0/1),
logical (TRUE/FALSE), or categorical binary labels.
Public fields
label_vocab
A named integer vector representing label-to-index mapping.
Methods
Inherited methods
Method new()
Initialize the processor with empty vocabulary.
Method fit()
Fit the processor by analyzing all unique labels in the dataset.
Usage
BinaryLabelProcessor$fit(samples, field)
Arguments
samples
A list of named lists (samples).
field
The name of the label field to process.
Method process()
Process a label into a torch tensor [0] or [1].
Usage
BinaryLabelProcessor$process(value)
Arguments
value
A single label value.
Returns
A float32 torch tensor of shape 1.
Method size()
Return the output dimensionality (fixed at 1).
Usage
BinaryLabelProcessor$size()
Print a summary of the processor.
Usage
BinaryLabelProcessor$print(...)
Method clone()
The objects of this class are cloneable with this method.
Usage
BinaryLabelProcessor$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.