Closed dmnapolitano closed 3 months ago
Hi Diane,
Thanks for your message. You can use instant_runoff_for_truncated_linear_orders to analyze the Burlington election. You can see an example here:
https://github.com/voting-tools/election-analysis/blob/main/burlington_vt_2009.ipynb
Fairly soon we will implement versions of instant runoff for an arbitrary ProfileWithTies (allowing ties in the middle of a ballot, which is not allowed in real political elections), which has been a topic of recent research.
Please let us know if you have any other questions!
Best, Wes
P.S. To clarify one point, it's true that in the Burlington election, some voters did assign multiple candidates the same rank. However, election officials consider that a mistake--an "overvote"--rather than a legitimate way of ranking candidates that the IRV algorithm will use to compute the winner. So to analyze the Burlington election at https://github.com/voting-tools/election-analysis/blob/main/burlington_vt_2009.ipynb, we first process the ballots so that all legitimate ballots have the form of truncated linear orders (i.e., there are no ties, but some candidates can be unranked; all unranked candidates are in effect considered tied for last place, which is the effect of prof.use_extended_strict_preference()).
Different jurisdictions have different rules for how to handle overvotes (see, e.g., https://github.com/voting-tools/election-analysis/blob/main/alaska_2022.ipynb) and other ballot anomalies, and unfortunately it is not always easy to find the exact rules.
Hi Wes,
Thanks, this is all really helpful! I can confirm that instant_runoff_for_truncated_linear_orders
and the examples in the notebook work here (which makes sense -- the 2006 and 2009 elections are pretty similar).
Based on this, I assumed all profiles/graphs listed in #1 worked with all rules/methods listed there. In hindsight, this was a silly assumption, but could I suggest you add a sentence or two to clarify that?
I'll close this issue since you're already working on it / it was my confusion 🙂
Hi Diane,
Yes, we will definitely clarify this--thanks!
In the meantime, if you look at the documentation for a specific voting method, it should say under "PARAMETERS" what kind of "edata" the method accepts.
Best, Wes
Hi!
I'm working with the data set for the 2006 Mayoral Election in Burlington, VT which you can download from here. This was an instant run-off election where voters were asked to rank their top five out of six candidates but were able to assign multiple candidates the same rank and also skip rankings.
Unfortunately, when I load the data into a
ProfileWithTies
object (see code below) calledprof
, then doinstant_runoff.display(prof)
, I receive the following error:I'm not entirely sure but I have some guesses as to where the fix needs to be made. It seems like all the various lists required by
instant_runoff
(and related classes) are alreadynumpy.array
s containing numeric data inProfile
but notProfileWithTies
.But, of course, the issue could be with the way I've created the
ProfileWithTies
object, although it can tell me the Condorcet winner and loser and alsofrom pref_voting.scoring_methods import borda
works properly:This is with Python 3.11 and the latest version of
pref-voting
installed viapip
(1.13.26).What do you think? 🤔
Thanks, Diane
CC openjournals/joss-reviews#7020