olpy/preprocessing/labels.py
def fit(self, y):
        """Fits the output vector y.

        This method parses the parsed value and sets the necessary 
        values to transform it later.

        Args:
            y (:obj:`list` or `numpy.ndarray`): the data to be transformed.

        Returns:
            self: the current instance.

        Raises:
            ValueError: if the number of labels is different than 2.
            AssertionError: if the positive label is not found in the
                labels.
        """
        self.y = y
        labels = np.unique(self.y)

        # First check that we have two values
        if len(labels) != 2:
            raise ValueError(
                'Expected two labels. Got {} instead'.format(len(labels))
                )

        # Let's check now that the specified positive label is in the array
        assert self.positive_label in labels,\
             'The positive label ({}) has not been found in the labels'
             
        self.labels = (
            set(labels).difference(
                {self.positive_label}
                ).pop(), self.positive_label)

        return self
Fits the output vector y.

        This method parses the parsed value and sets the necessary 
        values to transform it later.

        Args:
            y (:obj:`list` or `numpy.ndarray`): the data to be transformed.

        Returns:
            self: the current instance.

        Raises:
            ValueError: if the number of labels is different than 2.
            AssertionError: if the positive label is not found in the
                labels.
        
Fits the output vector y.
This method parses the parsed value and sets the necessary
values to transform it later.
Fits the output vector y . This method parses the parsed value and sets the necessary values to transform it later .
def fit(self, y):
        self.y = y
        labels = np.unique(self.y)
        if len(labels) != 2:
            raise ValueError(
                'Expected two labels. Got {} instead'.format(len(labels))
                )
        assert self.positive_label in labels,\
             'The positive label ({}) has not been found in the labels'
        self.labels = (
            set(labels).difference(
                {self.positive_label}
                ).pop(), self.positive_label)
        return self
def fit ( self , y ) : self . y = y labels = np . unique ( self . y ) if len ( labels ) != 2 : raise ValueError ( 'Expected two labels. Got {} instead' . format ( len ( labels ) ) ) assert self . positive_label in labels , 'The positive label ({}) has not been found in the labels' self . labels = ( set ( labels ) . difference ( { self . positive_label } ) . pop ( ) , self . positive_label ) return self
Fits the output vector y.
Fits the output vector y .
"""Fits the output vector y.

        This method parses the parsed value and sets the necessary 
        values to transform it later.

        Args:
            y (:obj:`list` or `numpy.ndarray`): the data to be transformed.

        Returns:
            self: the current instance.

        Raises:
            ValueError: if the number of labels is different than 2.
            AssertionError: if the positive label is not found in the
                labels.
        """ # First check that we have two values # Let's check now that the specified positive label is in the array
the current instance.
the current instance .
self
if the number of labels is different than 2.
if the number of labels is different than 2 .
ValueError
if the positive label is not found in the
labels.
if the positive label is not found in the labels .
AssertionError
self
y
y (
`list` or `numpy.ndarray`): the data to be transformed.
` list ` or ` numpy . ndarray ` ) : the data to be transformed .