View source: R/rank_candidates.R
| rank_candidates | R Documentation |
Calculates a ranking of candidates based on voters' preferences. Approval-Based Committe (ABC) rules are based on Lackner et al. (2023). For an example use in Machine Learning for ensemble feature selection, see Zobolas et al. (2026).
rank_candidates(
voters,
candidates,
weights = NULL,
committee_size = NULL,
method = "av",
borda_score = TRUE,
shuffle_candidates = TRUE,
check = FALSE
)
voters |
( |
candidates |
( |
weights |
( |
committee_size |
( |
method |
( |
borda_score |
( |
shuffle_candidates |
( |
check |
( |
We implement several consensus-based ranking methods, where voters express preferences for candidates. The framework has three components:
Voters: A list where each element is the set of approved candidates for a single voter.
Candidates: A character vector of all possible candidates. This vector can be shuffled to randomize tie-breaking across methods.
Weights: A numeric vector giving each voter’s influence. Equal weights mean equal influence; differing weights reflect varying importance.
This function is a thin wrapper that dispatches to method-specific implementations. Supported methods include:
Approval Voting (method = "av"), calls av()
Satisfaction Approval Voting (method = "sav"), calls sav()
Sequential Proportional Approval Voting (method = "seq_pav"), calls seq_pav()
Sequential Phragmen’s Rule (method = "seq_phragmen"), calls seq_phragmen()
All methods support voter weights.
For method-agnostic comparisons, we compute borda scores, which map each candidate’s rank to a normalized scale across methods that may otherwise return different score scales or only ordinal rankings.
For sequential methods such as "seq_pav" and "seq_phragmen", the
committee_size parameter can speed up computation by selecting only the top
N candidates instead of producing a full ranking. For non-sequential methods
(e.g., "sav" or "av"), it simply truncates the final ranking to the top
N candidates.
A data.frame with columns:
"candidate": Candidate names.
"score": Scores assigned to each candidate based on the selected method
(if applicable).
"norm_score": Normalized scores (if applicable), scaled to the range
[0,1], which can be loosely interpreted as selection probabilities
(see Meinshausen et al. (2010) for an example in Machine Learning research
where the goal is to perform stable feature selection).
"borda_score": Borda scores for method-agnostic comparison, ranging in
[0,1], where the top candidate receives a score of 1 and the lowest-ranked
candidate receives a score of 0.
Candidates are ordered by decreasing "score", or by "borda_score" if the
method returns only rankings.
Lackner M, Skowron P (2023). Multi-Winner Voting with Approval Preferences. Springer Nature, 121 p. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-031-09016-5")}.
Zobolas J, George A, Lopez A, Fischer S, Becker M, Aittokallio T (2026). "Prognostic biomarker discovery in pancreatic cancer through hybrid ensemble feature selection and multi-omics data." BioData Mining. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/s13040-026-00546-0")}.
Meinshausen N, Buhlmann P (2010). "Stability Selection." Journal of the Royal Statistical Society Series B: Statistical Methodology, 72(4), 417-473. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/J.1467-9868.2010.00740.X")}.
# 5 candidates
candidates = paste0("V", seq_len(5))
# 4 voters
voters = list(
c("V3", "V1", "V4"),
c("V3", "V1"),
c("V3", "V2"),
c("V2", "V4")
)
# voter weights
weights = c(1.1, 2.5, 0.8, 0.9)
# Approval voting (all voters equal)
rank_candidates(voters, candidates)
# Approval voting (voters unequal)
rank_candidates(voters, candidates, weights)
# Satisfaction Approval voting (voters unequal, no borda score)
rank_candidates(voters, candidates, weights, method = "sav", borda_score = FALSE)
# Sequential Proportional Approval voting (voters equal, no borda score)
rank_candidates(voters, candidates, method = "seq_pav", borda_score = FALSE)
# Sequential Phragmen's Rule (voters equal)
rank_candidates(voters, candidates, method = "seq_phragmen", borda_score = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.