(self, rate=0.3)
return IndexCollection([self.index[i] for i in perm])
Return a random sampled subset of this collection.

        Parameters
        ----------
        rate: float, optional (default=None)
            The rate of sampling. Must be a number in [0,1].

        Returns
        -------
        array: IndexCollection
            The sampled index collection.
Return a random sampled subset of this collection.
Return a random sampled subset of this collection .
def random_sampling(self, rate=0.3):
        """Return a random sampled subset of this collection.

        Parameters
        ----------
        rate: float, optional (default=None)
            The rate of sampling. Must be a number in [0,1].

        Returns
        -------
        array: IndexCollection
            The sampled index collection.
        """
        assert (0 < rate < 1)
        perm = randperm(len(self) - 1, round(rate * len(self)))
        return IndexCollection([self.index[i] for i in perm])
def random_sampling ( self , rate = 0.3 ) : assert ( 0 < rate < 1 ) perm = randperm ( len ( self ) - 1 , round ( rate * len ( self ) ) ) return IndexCollection ( [ self . index [ i ] for i in perm ] )