socialchoicekit.distortion module
- socialchoicekit.distortion.distortion(choice: ndarray | int, valuation_profile: ValuationProfile) → float[source]
This is a utility function to calculate distortion for voting as introduced by Procaccia and Rosenschein (2006)
Distortion is the worst case ratio between the optimal utility obtainable from cardinal information and the optimal utility obtainable from an algorithm using limited preference information.
distortion(f(P), v) = (max_{j in A} SW(j|v)) / SW(f(P) | v)
Parameters
- choiceUnion[np.ndarray, int]
The choice (winner) made by the social choice function (scf) voting the voting rule that is being evaluated, based on limited preference information. Assumed to be 1-indexed. The type allows for the output of the scf method of a voting rule to be passed in directly. If multiple choices are given, this function chooses the choice that maximizes the distortion.
- valuation_profileValuationProfile
A (N, M) array, where N is the number of agents and M is the number of items. The element at (i, j) indicates the agent’s value for item j. If the agent finds an item unacceptable or the agent’s preference is unknown, the element would be np.nan. Any np.nan values will be treated as 0.