@staticmethod
def plurality(probabilities, predictions):
    """Calculate the Plurality score for a mayor.

        Keyword arguments:
            probabilities -- a list of instances' probabilities,
                i.e, [ [voter's 1 instances' probabilities],
                       [voter's 2 instances' probabilities],
                       [voter's 3 instances' probabilities] ... ]
            predictions -- a list of instances' classes,
                i.e, [ [voter's 1 instances' classes],
                       [voter's 2 instances' classes],
                       [voter's 3 instances' classes] ... ]


        Score is calculated as the mean of class' probabilities.
        """
    ranking = list()
    n_classifiers = len(probabilities)
    n_instances = len(probabilities[0])
    for i in range(n_instances):
        class_count = dict()
        for c in range(n_classifiers):
            p = predictions[c][i]
            class_count[p] = class_count.get(p, 0) + 1
        class_rank = sorted(class_count.items(), key=lambda x: x[1],
            reverse=True)
        voted_class, n_votes = class_rank[0]
        sum_probabilities = 0
        for c in range(n_classifiers):
            if predictions[c][i] == voted_class:
                sum_probabilities += probabilities[c][i]
        prob_mean = sum_probabilities / n_votes
        ranking.append((i, prob_mean))
    ranking.sort(key=lambda x: x[0])
    return ranking
