pyhealth.processors.BinaryLabelProcessor#
Processor for binary label data.
- class pyhealth.processors.BinaryLabelProcessor[source]#
Bases:
FeatureProcessorProcessor for binary classification labels.
- process(value)[source]#
Process an individual field value.
- Parameters:
value (
Any) – Raw field value.- Return type:
Tensor- Returns:
Processed value.
- schema()[source]#
Returns the schema of the processed feature. For a processor that emits a single tensor, this should just return [“value”]. For a processor that emits a tuple of tensors, this should return a tuple of the same length as the tuple, with the semantic name of each tensor, such as [“time”, “value”], [“value”, “mask”], etc.
- Typical semantic names include:
“value”: the main processed tensor output of the processor
“time”: the time tensor output of the processor (mostly for StageNet)
“mask”: the mask tensor output of the processor (if applicable)
- spatial()[source]#
Whether each dimension (axis) of the value tensor is spatial (i.e. corresponds to a spatial axis like time, height, width, etc.) or not. This is used to determine how to apply augmentations and other transformations that should only be applied to spatial dimensions.
E.g. for CNN or RNN features, this would help determine which dimensions to apply spatial augmentations to, and which dimensions to treat as channels or features.
- load(path)#
Optional: Load processor state from disk.