Shortcuts

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

Binary allows 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.

__call__(*args, **kwargs) Dict[str, any][source]

Call self as a function.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources