hyppo/discrim/_utils.py
def _condition_input(self, x1):
        """Checks whether there is only one subject and removes
        isolates and calculate distance."""
        uniques, counts = np.unique(self.y, return_counts=True)

        if (counts != 1).sum() <= 1:
            msg = "You have passed a vector containing only a single unique sample id."
            raise ValueError(msg)

        if self.remove_isolates:
            idx = np.isin(self.y, uniques[counts != 1])
            self.y = self.y[idx]

            x1 = np.asarray(x1)
            if not self.is_distance:
                x1 = x1[idx]
            else:
                x1 = x1[np.ix_(idx, idx)]

        if not self.is_distance:
            x1 = pairwise_distances(x1, metric="euclidean")

        return x1
Checks whether there is only one subject and removes
        isolates and calculate distance.
Checks whether there is only one subject and removes
isolates and calculate distance.
Checks whether there is only one subject and removes isolates and calculate distance .
def _condition_input(self, x1):
        uniques, counts = np.unique(self.y, return_counts=True)
        if (counts != 1).sum() <= 1:
            msg = "You have passed a vector containing only a single unique sample id."
            raise ValueError(msg)
        if self.remove_isolates:
            idx = np.isin(self.y, uniques[counts != 1])
            self.y = self.y[idx]
            x1 = np.asarray(x1)
            if not self.is_distance:
                x1 = x1[idx]
            else:
                x1 = x1[np.ix_(idx, idx)]
        if not self.is_distance:
            x1 = pairwise_distances(x1, metric="euclidean")
        return x1
def _condition_input ( self , x1 ) : uniques , counts = np . unique ( self . y , return_counts = True ) if ( counts != 1 ) . sum ( ) <= 1 : msg = "You have passed a vector containing only a single unique sample id." raise ValueError ( msg ) if self . remove_isolates : idx = np . isin ( self . y , uniques [ counts != 1 ] ) self . y = self . y [ idx ] x1 = np . asarray ( x1 ) if not self . is_distance : x1 = x1 [ idx ] else : x1 = x1 [ np . ix_ ( idx , idx ) ] if not self . is_distance : x1 = pairwise_distances ( x1 , metric = "euclidean" ) return x1
Checks whether there is only one subject and removes
isolates and calculate distance.
Checks whether there is only one subject and removes isolates and calculate distance .
"""Checks whether there is only one subject and removes
        isolates and calculate distance."""
self
x1