def learn(self, matches, max_comparisons, recall) :
        '''
        Takes in a set of training pairs and predicates and tries to find
        a good set of blocking rules.
        '''
        if len(self.blocker.predicates) <= 40 :
            compound_length = 3
        else :
            compound_length = 2

        self.blocker.indexAll({i : record
                               for i, record
                               in enumerate(self.unroll(matches))})
        
        dupe_cover = cover(self.blocker, matches, compound_length)

        comparison_count = self.comparisons(self.total_cover, compound_length)

        dupe_cover = {pred : pairs
                      for pred, pairs
                      in viewitems(dupe_cover)
                      if comparison_count[pred] < max_comparisons}

        if not dupe_cover : 
            raise ValueError(NO_PREDICATES_ERROR)

        uncoverable_dupes = set(matches) - set.union(*viewvalues(dupe_cover))

        epsilon = int((1.0 - recall) * len(matches))

        if len(uncoverable_dupes) > epsilon :
            logger.warning(OUT_OF_PREDICATES_WARNING)
            logger.debug(uncoverable_dupes)
            epsilon = 0
        else :
            epsilon -= len(uncoverable_dupes)

        chvatal_set = greedy(dupe_cover.copy(), comparison_count, epsilon)

        dupe_cover = {pred : dupe_cover[pred] for pred in chvatal_set}

        final_predicates = tuple(dominating(dupe_cover))

        logger.info('Final predicate set:')
        for predicate in final_predicates :
            logger.info(predicate)

        return final_predicates
dataset/ETHPy150Open datamade/dedupe/dedupe/training.py/BlockLearner.learn/original