def thresholdBlocks(self, blocks, recall_weight=1.5):  # pragma : nocover

        probability = core.scoreDuplicates(self._blockedPairs(blocks),
                                           self.data_model,
                                           self.classifier,
                                           self.num_cores)['score']

        probability.sort()
        probability = probability[::-1]

        expected_dupes = numpy.cumsum(probability)

        recall = expected_dupes / expected_dupes[-1]
        precision = expected_dupes / numpy.arange(1, len(expected_dupes) + 1)

        score = recall * precision / (recall + recall_weight ** 2 * precision)

        i = numpy.argmax(score)

        logger.info('Maximum expected recall and precision')
        logger.info('recall: %2.3f', recall[i])
        logger.info('precision: %2.3f', precision[i])
        logger.info('With threshold: %2.3f', probability[i])

        return probability[i]
Returns the threshold that maximizes the expected F score, a
dataset/ETHPy150Open datamade/dedupe/dedupe/api.py/Matching.thresholdBlocks