Skip to main content

This contains the code for the work on embedded voting done during my internship at Nokia

Project description

Embedded Voting

https://img.shields.io/pypi/v/embedded_voting.svg https://img.shields.io/travis/TheoDlmz/embedded_voting.svg Documentation Status Code Coverage

This contains the code for the work on embedded voting done during my internship at Nokia

Features

  • Create a voting profile in which voters are associated to embeddings.

  • Run elections on these profiles with different rules, using the geometrical aspects of the embeddings.

  • The rules are defined for cardinal preferences, but some of them are adapted for the case of ordinal preferences.

  • There are rules for single-winner elections and multi-winner elections.

  • Classes to analyse the evolution of the score when the embeddings of one voter are changing.

  • Classes to analyse the manipulability of the rules.

  • Classes for algorithm aggregation.

  • A lot of tutorials.

Credits

This package was created with Cookiecutter and the francois-durand/package_helper project template.

History

0.1.6 (2023-01-23)

  • Aggregators: * Possibility to add or not the current ratings to the training set.

  • Embeddings:

    • The parameter norm has no default value (instead of True).

    • Fix a bug: when norm=False, the values of the attributes n_voter and n_dim were swapped by mistake.

    • Rename method scored to times_ratings_candidate.

    • Rename method _get_center to get_center, so that it is now part of the API.

    • Rename method normalize to normalized, recenter to recentered, dilate to dilated because they return a new Embeddings object (not modify the object in place).

    • Fix a bug in method get_center.

    • Methods get_center, recentered and dilated now also work with non-normalized embeddings.

    • Document that dilated can output embeddings that are not in the positive orthant.

    • Add dilated_new: new dilatation method whose output is in the positive orthant.

    • Add recentered_and_dilated: recenter and dilate the embeddings (using dilated_new).

    • Add mixed_with: mix the given Embeddings object with another one.

    • Rename plot_scores to plot_ratings_candidate.

  • Embeddings generators:

    • Rename EmbeddingsGeneratorRandom to EmbeddingsGeneratorUniform.

    • Add EmbeddingsGeneratorFullyPolarized: create embeddings that are random vectors of the canonical basis.

    • EmbeddingsGeneratorPolarized now relies on EmbeddingsGeneratorUniform, EmbeddingsGeneratorFullyPolarized and the method Embeddings.mixed_with.

    • Move EmbeddingCorrelation and renamed it.

    • Rewrote the EmbeddingsFromRatingsCorrelation and how it compute the number of singular values to take.

  • Epistemic ratings generators:

    • Add TruthGenerator: a generator for the ground truth (“true value”) of each candidate.

    • Add TruthGeneratorUniform: a uniform generator for the ground truth (“true value”) of each candidate.

    • RatingsGeneratorEpistemic and its subclasses now take a TruthGenerator as parameter.

    • Add RatingsGeneratorEpistemicGroups as an intermediate class between the parent class RatingsGeneratorEpistemic and the child classes using groups of voters.

    • RatingsGeneratorEpistemic now do not take groups sizes as parameter: only RatingsGeneratorEpistemicGroups and its subclasses do.

    • Rename RatingsGeneratorEpistemicGroupedMean to RatingsGeneratorEpistemicGroupsMean, RatingsGeneratorEpistemicGroupedMix to RatingsGeneratorEpistemicGroupsMix RatingsGeneratorEpistemicGroupedNoise to RatingsGeneratorEpistemicGroupsNoise.

    • Remove method RatingsGeneratorEpistemic.generate_true_values: the same result can be obtained with RatingsGeneratorEpistemic.truth_generator.

    • Add RatingsGeneratorEpistemicGroupedMixFree and RatingsGeneratorEpistemicGroupsMixScale.

  • Ratings generators:

    • RatingsGenerator and subclasses: remove *args in call because it was not used.

    • RatingsGeneratorUniform: add optional parameters minimum_rating and maximum_rating.

    • Possibility to save scores in a csv file

  • RatingsFromEmbeddingsCorrelated:

    • Move parameter coherence from __call__ to __init__.

    • Rename parameter scores_matrix to ratings_dim_candidate.

    • Parameters n_dim and n_candidates are optional if ratings_dim_candidate is specified.

    • Add optional parameters minimum_random_rating, maximum_random_rating and clip.

    • Parameter clip now defaults to False (the former version behaved as if clip was always True).

  • Single-winner rules:

    • Rename ScoringRule to Rule.

    • Rename all subclasses accordingly. For example, rename FastNash to RuleFastNash.

    • Rename SumScores to RuleSumRatings and ProductScores to RuleProductRatings.

    • Rename RulePositionalExtension to RulePositional and rename subclasses accordingly.

    • Rename RuleInstantRunoffExtension to RuleInstantRunoff.

    • Add RuleApprovalSum, RuleApprovalProduct, RuleApprovalRandom.

    • Changed the default renormalization function in RuleFast.

    • Change the method in RuleMLEGaussian.

    • Add RuleModelAware.

    • Add RuleRatingsHistory.

    • Add RuleShiftProduct which replace RuleProductRatings.

  • Multiwinner rules: rename all rules with prefix MultiwinnerRule. For example, rename IterFeatures to MultiwinnerRuleIterFeatures.

  • Manipulation:

    • Rename SingleVoterManipulation to Manipulation and rename subclasses accordingly.

    • Rename SingleVoterManipulationExtension to ManipulationOrdinal and rename subclasses accordingly.

    • Rename ManipulationCoalitionExtension to ManipulationCoalitionOrdinal and rename subclasses accordingly.

  • Rename AggregatorSum to AggregatorSumRatings and AggregatorProduct to AggregatorProductRatings.

  • Add max_angular_dilatation_factor: maximum angular dilatation factor to stay in the positive orthant.

  • Rename create_3D_plot to create_3d_plot.

  • Moved function to the utils module.

  • Reorganize the file structure of the project.

0.1.5 (2022-01-04)

  • Aggregator functions.

  • Online learning.

  • Refactoring Truth epistemic generators.

  • Rule taking history into account.

0.1.4 (2021-12-06)

  • New version with new structure for Ratings and Embeddings

0.1.3 (2021-10-27)

  • New version with new internal structure for the library

0.1.2 (2021-07-05)

  • New version with handy way to use the library for algorithm aggregation and epistemic social choice

0.1.1 (2021-04-02)

  • Minor bugs.

0.1.0 (2021-03-31)

  • End of the internship, first release on PyPI.

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

embedded_voting-0.1.6.tar.gz (91.9 kB view details)

Uploaded Source

Built Distribution

embedded_voting-0.1.6-py2.py3-none-any.whl (111.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file embedded_voting-0.1.6.tar.gz.

File metadata

  • Download URL: embedded_voting-0.1.6.tar.gz
  • Upload date:
  • Size: 91.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for embedded_voting-0.1.6.tar.gz
Algorithm Hash digest
SHA256 422bea3a99a58810015b226531e237ae45b474aa94e7b96fa5cd7c7d535b5136
MD5 8be41b146157456d2c2d7a845e4636ee
BLAKE2b-256 f13af0594c1565e7bde03eb2cc68289e93308247b76c668b9ebfbc329f610098

See more details on using hashes here.

File details

Details for the file embedded_voting-0.1.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for embedded_voting-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 712b06ed2c9b663dd8f2c32c13488bb01eaea02aa7f3da178442ce895a55b6c8
MD5 75b41ad4f30b48a3a6708924da437273
BLAKE2b-256 b02c89f3fc8ac286088faefd0abfce0f014560adf3733a9b864a760839b7c9e9

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