olpy/preprocessing/labels.py
def transform(self, return_labels=True):
        """Transforms the data.

        Based on the information collected while fitting, this fuction
        returns the transformed labels that can be used directly for
        training.

        Args:
            return_labels (bool, optional): whether the labels should
                be returned or not. Default `True`.

        Returns:
            `numpy.ndarray` if return_labels is True else None

        Raises:
            NotFittedError if the encoder was not already fitted.
        """
        # All is okay. Now we can change
        if self.y is None:
            raise NotFittedError(
                    None, 
                    None, 
                    'Attempted to transform an unfitted encorder.'
                )
        if return_labels:
            return (
                np.array(
                    [1 if self.y[i] == self.positive_label 
                    else -1 for i in range(self.y.shape[0])]), 
                self.labels
            )
        else:
            return np.array(
                [1 if self.y[i] == self.positive_label 
                else -1 for i in range(self.y.shape[0])])
Transforms the data.

        Based on the information collected while fitting, this fuction
        returns the transformed labels that can be used directly for
        training.

        Args:
            return_labels (bool, optional): whether the labels should
                be returned or not. Default `True`.

        Returns:
            `numpy.ndarray` if return_labels is True else None

        Raises:
            NotFittedError if the encoder was not already fitted.
        
Transforms the data.
Based on the information collected while fitting, this fuction
returns the transformed labels that can be used directly for
training.

return_labels (bool, optional): whether the labels should
be returned or not. Default `True`.

`numpy.ndarray` if return_labels is True else None

NotFittedError if the encoder was not already fitted.
Transforms the data . Based on the information collected while fitting this fuction returns the transformed labels that can be used directly for training . return_labels ( bool optional ) : whether the labels should be returned or not . Default ` True ` . ` numpy . ndarray ` if return_labels is True else None NotFittedError if the encoder was not already fitted .
def transform(self, return_labels=True):
        if self.y is None:
            raise NotFittedError(
                    None, 
                    None, 
                    'Attempted to transform an unfitted encorder.'
                )
        if return_labels:
            return (
                np.array(
                    [1 if self.y[i] == self.positive_label 
                    else -1 for i in range(self.y.shape[0])]), 
                self.labels
            )
        else:
            return np.array(
                [1 if self.y[i] == self.positive_label 
                else -1 for i in range(self.y.shape[0])])
def transform ( self , return_labels = True ) : if self . y is None : raise NotFittedError ( None , None , 'Attempted to transform an unfitted encorder.' ) if return_labels : return ( np . array ( [ 1 if self . y [ i ] == self . positive_label else - 1 for i in range ( self . y . shape [ 0 ] ) ] ) , self . labels ) else : return np . array ( [ 1 if self . y [ i ] == self . positive_label else - 1 for i in range ( self . y . shape [ 0 ] ) ] )
Transforms the data.
Transforms the data .
"""Transforms the data.

        Based on the information collected while fitting, this fuction
        returns the transformed labels that can be used directly for
        training.

        Args:
            return_labels (bool, optional): whether the labels should
                be returned or not. Default `True`.

        Returns:
            `numpy.ndarray` if return_labels is True else None

        Raises:
            NotFittedError if the encoder was not already fitted.
        """ # All is okay. Now we can change
self
return_labels