Skip to main content

socialchoicekit aims to be a comprehensive implementation of the most important rules in computational social choice theory.

Project description

socialchoicekit

Netlify Status

socialchoicekit aims to be a comprehensive implementation of the most important rules in computational social choice theory. It is currently in development by Natsu Ozawa under the supervision of Dr. Aris Filos-Ratsikas at the University of Edinburgh.

This library supports Python 3.8 and above.

Documentation can be found here

Concepts

Social Choice Theory

Social choice theory [Sen, 1986] is the study of aggregating individual preferences into a collective decision. Social choice theory has been used to formulate, analyze, and evaluate decision making processes in a number of settings.

In this library, we use the following settings.

  • Voting: The goal is to select a candidate or proposal that best represents individual votes by an electoral process. Also known as the general social choice setting, this setting is the most studied.
  • Resource allocation: The goal is to match agents to items while respecting preferences of the agent. In this library, we simply call it allocation. Also known as matching with one sided preferences.
  • Matching: The goal is to match agents from one group to agents in another while respecting preferences of all agents. Also known as matching with two sided preferences.

Distortion

In this library, we especially focus on algorithms that are used in the study of distortion. 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.

Usage

Example Usage

from socialchoicekit.deterministic_scoring import Plurality

rule = Plurality()
profile = np.array([[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]])
rule.scf(profile)

Development

Create a virtual environment and install from requirements.txt

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Compile documentation

Sphinx with autodoc is used to compile documentation.

(Run this command when a new module is added)

sphinx-apidoc -e -o docs/ socialchoicekit/
cd docs
make html

To locally view the compiled documentation, use

cd docs/_build/html
python -m http.server

Build

python setup.py sdist bdist_wheel

If there is an error: invalid command 'bdist_wheel', type:

pip install wheel

and try again.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socialchoicekit-1.0.0rc1.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

socialchoicekit-1.0.0rc1-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file socialchoicekit-1.0.0rc1.tar.gz.

File metadata

  • Download URL: socialchoicekit-1.0.0rc1.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for socialchoicekit-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 1c33f89b070755521d558998b112a9dc2d2d399ee0abdc32761a02b83c5bcb2e
MD5 0c2ded871d910afd8c943de1c119e7b0
BLAKE2b-256 3f1d3e2a5af7617ca829dfc255679c7733cdda7a912cf32c2b63ee135da5464c

See more details on using hashes here.

File details

Details for the file socialchoicekit-1.0.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for socialchoicekit-1.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e975181a157a833d5da07829a8fbdd82dd1f41c3f97d71661b527f5f8ebb574
MD5 d51f29373d553b1eecb17a96b5af893e
BLAKE2b-256 bedccbe7a300ae81d0b61817cbe93b6bb86f56af1f02fbe9b16cea2d624ab23f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page