(self, class_filter)
return self.subset([i for i, j in enumerate(self.samples)
                if rule(self.data_source[j])])
Returns only the subset matching the given rule.
Returns only the subset matching the given rule.
Returns only the subset matching the given rule .
def class_subset(self, class_filter):
        '''
        Returns only the subset matching the given rule.
        '''
        if isinstance(class_filter, int):
            rule = lambda d: d[1] == class_filter
        else:
            rule = class_filter
        return self.subset([i for i, j in enumerate(self.samples)
                if rule(self.data_source[j])])
def class_subset ( self , class_filter ) : if isinstance ( class_filter , int ) : rule = lambda d : d [ 1 ] == class_filter else : rule = class_filter return self . subset ( [ i for i , j in enumerate ( self . samples ) if rule ( self . data_source [ j ] ) ] )