-
Notifications
You must be signed in to change notification settings - Fork 3
Description
In #19 we had to make a change to the leximin algorithm, in particular changing the initial weights from all being 1.0 to being a random choice between 0.8 and 1.0.
The code at that commit (before refactoring) was at
stratification-app/stratification.py
Line 1483 in ffbf19e
| weights = {id: random.uniform(0.8, 1.0) for id in agent_vars} |
# We begin using a multiplicative-weight stage. Each agent has a weight between 0.8 and 1
# Note that if all start with the same weight then we can end up with some committees
# having the wrong number of results.
weights = {id: random.uniform(0.8, 1.0) for id in agent_vars}Before making that change, we found that when running a test expecting 46 in a committee, the first committee would actually have 49.
@foobacca noticed that for subsequent rounds the weights were changed - sometimes decreased for some members, to make it more likely others would be included, and sometimes increased across the board if we're getting the same result more than once. So every round apart from the first round has a mix of weights and every round apart from the first round produced the expected number of committee members (46). That led to trying the initial weight randomisation, which worked.
Questions we'd like to investigate:
- did the tests and algorithm work fine when the work was done originally committed? If so, we could try a
git bisectto see what broke the code. - is there any reason that random weights would cause something bad to happen?
- can we try reducing the variation - say random values from 0.98 to 1 - to see if that keeps the tests passing with less difference from the initial version.
- can we understand how we end up with the wrong number of members of the committee. Do we need to deepen our understanding of the original algorithm.