Download the PHP package mieuxvoter/majority-judgment without Composer
On this page you can find all versions of the php package mieuxvoter/majority-judgment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mieuxvoter/majority-judgment
More information about mieuxvoter/majority-judgment
Files in mieuxvoter/majority-judgment
Package majority-judgment
Short Description Rank the candidates of your polls using Majority Judgment with a fast, robust, interface-oriented and scalable algorithm.
License MIT
Informations about the package majority-judgment
Majority Judgment Library for PHP
Rank candidates of Majority Judgment polls.
Features
- [x] Majority judgment deliberation from merit profiles
- [x] Fast & extensible
- [x] Supports billions of voters
- [x] Supports thousands of candidates
- [x] Test-Driven Development
- [x] No floating-point arithmetic
- [x] Using composer and namespaces
Installation
Require it in your own project, using composer:
composer require mieuxvoter/majority-judgment
Usage example
Let's say you have a poll with three candidates and merit profiles like so:
You can get the rank of each candidate like so:
[!TIP] These images were generated with our online merit profile tool.
Unbalanced Tallies
If your tally is unbalanced, because some proposals received more judgments than others, you will need to balance the tally using one of the provided balancing methods (or your own).
Using ad hoc normalization
This is akin to using percentages to resolve Majority Judgment, instead of tallies.
This kind of balancing is relevant when:
- there are many proposals in your poll
- users cannot be expected to judge them all
- you ensured that participation is somewhat balanced
- you excluded proposals that received too little participation
Using a Static Default Grade
The most common balancing strategy is to consider missing judgments as of the "worst" grade. This incentivizes candidates to be clear and to promote themselves.
Here's how one can use the Balancer to balance a poll tally:
Using the Median Grade
I can't fathom why you'd want this, but here it is anyway:
[!WARNING] This balancing strategy is not very interesting, nor fair. You probably should prefer normalization, or using the lowest grade.
Testing
See the tests in test/.
composer install
vendor/bin/phpunit test