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.
from torcheeg import transforms t = transforms.Binary(threshold=5.0) t(y=4.5)['y'] >>> 0
Binary
allows simultaneous binarization using the same threshold for multiple labels.from torcheeg import transforms t = transforms.Binary(threshold=5.0) t(y=[4.5, 5.5])['y'] >>> [0, 1]
- Parameters:
threshold (float) – Threshold used during binarization.