votesim.votesystems.score¶
Function Summary¶
|
Approval voting with 100% cutoff threshold; rounds scores. |
|
Approval voting with 25% cutoff threshold; rounds scores. |
|
Approval voting with 50% cutoff threshold; rounds scores. |
|
|
|
Majority judgment (median score). |
|
Multi-winner election using reweighted range voting. |
|
Score voting. |
|
Score voting specifying 11 total score bins from 0 to 10. |
|
Score voting specifying 6 total score bins from 0 to 5. |
|
Multi-winner score based on Parker_Friedland’s Reddit post https://www.reddit.com/r/EndFPTP/comments/auyxny/can_anyone_give_a_summary_of_multiwinner_methods/ehgkfbl/ |
|
STAR voting (Score then Automatic Runoff) |
|
STAR voting with 11 total score bins from 0 to 10. |
|
STAR voting with 6 total score bins from 0 to 5. |
Module Functions¶
approval100¶
approval25¶
approval50¶
majority_judgment¶
-
votesim.votesystems.score.
majority_judgment
(data, numwin=1, remove_nulls=True, maxiter=100000.0)¶ Majority judgment (median score).
- Parameters
data (array shaped (a, b)) –
Election voter scores, 0 to max. Data of candidate ratings for each voter, with
a Voters represented as each rows
b Candidates represented as each column.
numwin (int) – Number of winners to consider
remove_nulls (bool) – If True (default), remove any ballots that are marked with all zeros.
- Returns
winners (array of shape (numwin,)) – Winning candidates index.
ties (array of shape (tienum,)) – Tied candidates index for the last round, numbering ‘tienum’.
sums (array of shape (numwin, b)) – Median scores for each candidate.
reweighted_range¶
-
votesim.votesystems.score.
reweighted_range
(data, numwin=1, C_ratio=1.0, maxscore=None)¶ Multi-winner election using reweighted range voting.
https://www.rangevoting.org/RRVr.html
- Parameters
data (array shaped (a, b)) –
Election voter scores, 0 to max. Data of candidate ratings for each voter, with
a Voters represented as each rows
b Candidates represented as each column.
numwin (int) – Number of winners to consider
C_ratio (float) –
Proportionality factor
C_ratio = 1.0 – M; Greatest divisors (d’Hondt, Jefferson) proportionality
C_ratio = 0.5 – M/2; Major fractions (Webster, Saint-Lague) method
maxscore (None (default), float) – Maximum score to use for calculation of C. Use max of data if None.
- Returns
winners (array of shape (numwin,)) – Winning candidates index.
ties (array of shape (tienum,)) – Tied candidates index for the last round, numbering ‘tienum’.
round_history (array of shape (numwin, b)) – Score summations for each candidate, for each round.
rows numwin – Represents each round for total number of winners
columns b – Represents each candidate.
data is net score of each candidate for each round.
score¶
-
votesim.votesystems.score.
score
(data, numwin=1)¶ Score voting.
- Parameters
data (array shaped (a, b)) –
Election voter scores, 0 to max. Data of candidate ratings for each voter, with
a Voters represented as each rows
b Candidates represented as each column.
numwin (int) – Number of winners to consider
- Returns
winners (array of shape (numwin,)) – Winning candidates index.
ties (array of shape (tienum,)) – Tied candidates index for the last round, numbering ‘tienum’.
sums (array of shape (numwin, b)) – Score summations for each candidate.
score10¶
score5¶
sequential_monroe¶
-
votesim.votesystems.score.
sequential_monroe
(data, numwin=1, maxscore=None)¶ Multi-winner score based on Parker_Friedland’s Reddit post https://www.reddit.com/r/EndFPTP/comments/auyxny/can_anyone_give_a_summary_of_multiwinner_methods/ehgkfbl/
For candidate X, sort the ballots in order of highest score given to candidate X to lowest score given to candidate X.
Calculate the average score given to X on the first hare quota of those ballots. Record this score as that candidate’s hare quota score. See Footnote.
Repeat this process for every candidate.
Elect the candidate with the highest hare quota score and exhaust the votes that contribute to that candidate’s hare quota score.
Repeat this process until all the seats are filled.
- Parameters
data (array shaped (a, b)) –
Election voter scores, 0 to max. Data of candidate ratings for each voter, with
a Voters represented as each row.
b Candidates represented as each column.
numwin (int) – Number of winners to consider
- Returns
winners (array of shape (numwin,)) – Winning candidates index.
ties (array of shape (tienum,)) – Tied candidates index for the last round, numbering ‘tienum’.
round_history (array of shape (numwin, b)) – Average scores of top quota for each candidate, for each round.
rows numwin – Represents each round for total number of winners
columns b – Represents each candidate.
data is net score of each candidate for each round.
star¶
-
votesim.votesystems.score.
star
(data, numwin=1)¶ STAR voting (Score then Automatic Runoff)
- Parameters
data (array shaped (a, b)) –
Election voter scores, 0 to max. Data of candidate ratings for each voter, with
a Voters represented as each rows
b Candidates represented as each column.
numwwin (int) – Multi-winners… parameter > 1 not supported!!
- Returns
winners (array of shape (numwin,)) – Winning candidates index.
ties (array of shape (tienum,)) – Tied candidates index for the last round, numbering ‘tienum’.
output (dict) –
- sumsarray shape (b,)
Score sums for all candidates
- runoff_candidatesarray shape (c,)
Candidates that made the runoff
- runoff_matrixarray shape (c, c)
Votes for and against each candidate in runoff
- runoff_sumsarray shape (c,)
Votes for each candidate in runoff