@classmethod
    def grouped_distribution(cls, instance):
        """Returns a distribution formed by grouping the distributions of
           each predicted node.

        """
        joined_distribution = {}
        distribution_unit = 'counts'
        for prediction in instance.predictions:
            joined_distribution = merge_distributions(
                joined_distribution,
                dict((x[0], x[1]) for x in prediction['distribution']))
            # when there's more instances, sort elements by their mean
            distribution = [list(element) for element in
                            sorted(joined_distribution.items(),
                                   key=lambda x: x[0])]
            if distribution_unit == 'counts':
                distribution_unit = ('bins' if BINS_LIMIT > len(distribution)
                                     else 'counts')
            distribution = merge_bins(distribution, BINS_LIMIT)
        return {'distribution': distribution,
                'distribution_unit': distribution_unit}
dataset/ETHPy150Open bigmlcom/python/bigml/multivote.py/MultiVote.grouped_distribution/swapped operands of `>`