def _sample_item(self, **kwargs):
        """Sample an item from the pool"""
        if self.replace:
            # Can sample from any of the items
            loc = np.random.choice(self._n_items)
        else:
            # Can only sample from items that have not been seen
            # Find ids that haven't been seen yet
            not_seen_ids = np.where(np.isnan(self.cached_labels_))[0]
            loc = np.random.choice(not_seen_ids)
        return loc, 1, {}
def _sample_item ( self , ** kwargs ) : if self . replace : loc = np . random . choice ( self . _n_items ) else : not_seen_ids = np . where ( np . isnan ( self . cached_labels_ ) ) [ 0 ] loc = np . random . choice ( not_seen_ids ) return loc , 1 , { }
Sample an item from the pool