(self)
Create a random sample if the data is larger than the set sample size
Create a random sample if the data is larger than the set sample size
Create a random sample if the data is larger than the set sample size
def _create_sample(self):
        """
        Create a random sample if the data is larger than the set sample size
        """
        self.n_shown = min(self.n_valid, self.sample_size or self.n_valid)
        if self.sample_size is not None \
                and self.sample_indices is None \
                and self.n_valid != self.n_shown:
            random = np.random.RandomState(seed=0)
            self.sample_indices = random.choice(
                self.n_valid, self.n_shown, replace=False)
            # TODO: Is this really needed?
            np.sort(self.sample_indices)
def _create_sample ( self ) : self . n_shown = min ( self . n_valid , self . sample_size or self . n_valid ) if self . sample_size is not None and self . sample_indices is None and self . n_valid != self . n_shown : random = np . random . RandomState ( seed = 0 ) self . sample_indices = random . choice ( self . n_valid , self . n_shown , replace = False ) # TODO: Is this really needed? np . sort ( self . sample_indices )