BinaryOneVSRest¶
- class torcheeg.transforms.BinaryOneVSRest(positive: int)[source][source]¶
Binarize the label following the fashion of the one-vs-rest strategy. When label is the specified positive category label, the label is set to 1, when the label is any other category label, the label is set to 0.
transform = BinaryOneVSRest(positive=1) transform(y=2)['y'] >>> 0
Binaryallows simultaneous binarization using the same threshold for multiple labels.transform = BinaryOneVSRest(positive=1) transform(y=[1, 2])['y'] >>> [1, 0]
- Parameters
positive (int) – The specified positive category label.