Skip to contents

Processor for binary classification labels. Supports numeric (0/1), logical (TRUE/FALSE), or categorical binary labels.

Super classes

RHealth::Processor -> RHealth::FeatureProcessor -> BinaryLabelProcessor

Public fields

label_vocab

A named integer vector representing label-to-index mapping.

Methods

Inherited methods


Method new()

Initialize the processor with empty vocabulary.

Usage


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()

Returns

Integer 1


Method print()

Print a summary of the processor.

Usage

BinaryLabelProcessor$print(...)

Arguments

...

Ignored.


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.