Instant Runoff voting¶
-
class
embedded_voting.
RuleInstantRunoff
(rule=None)[source]¶ This class enables to extend a voting rule to an ordinal input with Instant Runoff ranking. You cannot access to the
scores_
because IRV only compute the ranking of the candidates.Parameters: rule (Rule) – The aggregation rule used to determine the aggregated scores of the candidates. Examples
>>> ratings = np.array([[.1, .2, .8, 1], [.7, .9, .8, .6], [1, .6, .1, .3]]) >>> embeddings = Embeddings(np.array([[1, 0], [1, 1], [0, 1]]), norm=True) >>> election = RuleInstantRunoff(RuleSVDNash())(ratings, embeddings) >>> election.ranking_ [1, 0, 2, 3]