MajorityJudgment¶
-
class
svvamp.
MajorityJudgment
(population, **kwargs)[source]¶ Majority Judgment.
Inherits functions and optional parameters from superclasses
ElectionResult
andElection
.Parameters: - min_grade – See attribute
min_grade
. - max_grade – See attribute
max_grade
. - step_grade – See attribute
step_grade
. - rescale_grades – See attribute
rescale_grades
.
Example: >>> import svvamp >>> pop = svvamp.PopulationSpheroid(V=100, C=5) >>> election = svvamp.MajorityJudgment(pop, min_grade=0, max_grade=1, step_grade=0, rescale_grades=True)
Each voter attributes a grade to each candidate. By default, authorized grades are all numbers in the interval [
min_grade
,max_grade
]. To use a discrete set of notes, modify attributestep_grade
.Note
Majority Judgement, as promoted by its authors, uses a discrete set of non-numerical grades. For our purpose, using a discrete set of numerical grades (
step_grade
> 0) is isomorphic to this voting system. In contrast, using a continuous set of grades (step_grade
= 0) is a variant of this voting system, which has the advantage of being canonical, in the sense that there is no need to choose the number of authorized grades more or less arbitrarily.The candidate with highest median grade wins. For the tie-breaking rule, see
scores
.Default behavior of sincere voters: voter
v
applies an affine transformation to her utilitiespreferences_ut
[v, :]
to get her grades, such that her least-liked candidate receivesmin_grade
and her most-liked candidate receivesmax_grade
. To modify this behavior, use attributerescale_grades
. For more details about the behavior of sincere voters, seeballots
.- If
rescale_grades
=False
, then Majority Judgment always meets IIA. - If
rescale_grades
=True
, then then non-polynomial or non-exact algorithms from superclassElection
are used.
CM()
,ICM()
,IM()
,TM()
,UM()
: Exact in polynomial time.References:
Majority Judgment : Measuring, Ranking, and Electing. Michel Balinski and Rida Laraki, 2010.-
ballots
¶ 2d array of integers.
ballots[v, c]
is the grade attributed by voterv
to candidatec
(when voting sincerely). The following process is used.Convert utilities into grades in interval [
min_grade
,max_grade
].If
rescale_grades
=True
, then each voterv
applies an affine transformation topreferences_ut
[v, :]
such that her least-liked candidate receivesmin_grade
and her most-liked candidate receivesmax_grade
.Exception: if she is indifferent between all candidates, then she attributes (
min_grade
+max_grade
) / 2 to all of them.If
rescale_grades
=False
, then each voterv
clips her utilities into the interval [min_grade
,max_grade
]: each utility greater thanmax_grade
(resp. lower thanmin_grade
) becomesmax_grade
(resp.min_grade
).
If
step_grades
> 0 (discrete set of grades), round each grade to the closest authorized grade.
-
max_grade
¶ Number. Maximal grade allowed.
-
min_grade
¶ Number. Minimal grade allowed.
-
rescale_grades
¶ Boolean. Whether sincere voters rescale their utilities to produce grades.
If
rescale_grades
=True
, then each sincere voterv
applies an affine transformation to send her utilities into the interval [min_grade
,max_grade
].If
rescale_grades
=False
, then each sincere voterv
clips her utilities into the interval [min_grade
,max_grade
].See
ballots
for more details.
-
scores
¶ 2d array of integers.
scores[0, c]
is the median grade of candidatec
.Let us note
p
(resp.q
) the number of voter who attribute toc
a grade higher (resp. lower) than the median. Ifp
>q
, thenscores[1, c]
=p
. Otherwise,scores[1, c]
=-q
.
-
step_grade
¶ Number. Interval between two consecutive allowed grades.
If
step_grade = 0
, all grades in the interval [min_grade
,max_grade
] are allowed (‘continuous’ set of grades).If
step_grade > 0
, authorized grades are the multiples ofstep_grade
lying in the interval [min_grade
,max_grade
]. In addition, the gradesmin_grade
andmax_grade
are always authorized, even if they are not multiples ofstep_grade
.
- min_grade – See attribute