Grade Methods

Score Voting

pref_voting.grade_methods.score_voting(gprofile, curr_cands=None, evaluation_method='sum')[source]

Return the candidates with the largest scores, where scores are evaluated using the evaluation_method, where the default is summing the scores of the candidates. If curr_cands is provided, then the score vote is restricted to the candidates in curr_cands.

Approval

pref_voting.grade_methods.approval(gprofile, curr_cands=None)[source]

Return the approval vote of the grade profile gprofile. If curr_cands is provided, then the approval vote is restricted to the candidates in curr_cands.

Warning

Approval Vote only works on Grade Profiles that are based on 2 grades: 0 and 1.

STAR

pref_voting.grade_methods.star(gprofile, curr_cands=None)[source]

Identify the top two candidates according to the sum of the grades for each candidate. Then hold a runoff between the top two candidates where the candidate that is ranked above the other by the most voters is the winner. The candidates that move to the runoff round are: the candidate(s) with the largest sum of the grades and the candidate(s) with the 2nd largest sum of the grades (or perhaps tied for the largest sum of the grades). In the case of multiple candidates tied for the largest or 2nd largest sum of the grades, use parallel-universe tiebreaking: a candidate is a Star Vote winner if it is a winner in some head-to-head runoff as described. If the candidates are all tied for the largest sum of the grades, then all candidates are winners.

See https://starvoting.us for more information.

If curr_cands is provided, then the winners is restricted to the candidates in curr_cands.

Warning

Star Vote only works on Grade Profiles that are based on 6 grades: 0, 1, 2, 3, 4, and 5.

Cumulative Voting

pref_voting.grade_methods.cumulative_voting(gprofile, curr_cands=None, max_total_grades=5)[source]

Return the cumulative vote winner of the grade profile gprofile. This is the candidates with the largest sum of the grades where each voter submits a ballot of scores that sum to max_total_grades. If curr_cands is provided, then the cumulative vote is restricted to the candidates in curr_cands.

Greatest Median

pref_voting.grade_methods.greatest_median(gprofile, curr_cands=None, tb_func=<function tiebreaker_majority_judgement>)[source]

Returns the candidate(s) with the greatest median grade. If there is a tie, the tie is broken by the tiebreaker function.

Tiebreaker Functions

pref_voting.grade_methods.tiebreaker_diff(gprofile, cand, median_grade)[source]

Tiebreaker when the there are multiple candidates with the largest median grade. The tiebreaker is the difference between the proportion of voters who grade the candidate higher than the median grade and the proportion of voters who grade the candidate lower than the median grade.

pref_voting.grade_methods.tiebreaker_relative_shares(gprofile, cand, median_grade)[source]

Tiebreaker when the there are multiple candidates with the largest median grade. Returns the relative shares of the proponents and opponents of the candidate.

pref_voting.grade_methods.tiebreaker_normalized_difference(gprofile, cand, median_grade)[source]

Tiebreaker when the there are multiple candidates with the largest median grade. Returns the normalized difference of the proponents and opponents of the candidate.

pref_voting.grade_methods.tiebreaker_majority_judgement(gprofile, cand, median_grade)[source]

Tiebreaker when the there are multiple candidates with the largest median grade. Returns the proportion of voters assigning a higher grade than the median to cand if it is greater than the proportion of voters assigning a lower grade than the median to cand, otherwise return -1 * the proportion of voters assigning a lower grade than the median to cand.

Majority Judgement

pref_voting.grade_methods.majority_judgement(gprofile, curr_cands=None)[source]

The Majority Judgement voting method as describe in Balinski and Laraki (https://mitpress.mit.edu/9780262545716/majority-judgment/).