'Generates boolean masks corresponding to test sets.'

def _iter_test_masks(self):

    for f in self.unique_folds:
        test_index = np.where((self.test_fold == f))[0]
        test_mask = np.zeros(len(self.test_fold), dtype=np.bool)
        test_mask[test_index] = True
        (yield test_mask)
