Binary¶
- class torcheeg.transforms.Binary(threshold: float)[source][source]¶
Binarize the label according to a certain threshold. Labels larger than the threshold are set to 1, and labels smaller than the threshold are set to 0.
transform = Binary(threshold=5.0) transform(y=4.5)['y'] >>> 0
Binaryallows simultaneous binarization using the same threshold for multiple labels.transform = Binary(threshold=5.0) transform(y=[4.5, 5.5])['y'] >>> [0, 1]
- Parameters:
threshold (float) – Threshold used during binarization.