Skip to main content

elex-solver

This packages includes solvers for:

  • Ordinary least squares regression
  • Quantile regression
  • Transition matrices

Installation

Ordinary least squares

We have our own implementation of ordinary least squares in Python because this let us optimize it towards the bootstrap by storing and re-using the normal equations. This allows for significant speed up.

Quantile Regression

Since we did not find any implementations of quantile regression in Python that fit our needs, we decided to write one ourselves. At the moment this uses two libraries, the version that solves the non-regularized problem uses numpyand solves the dual based on this paper. The version that solves the regularized problem uses cvxpy and sets up the problem as a normal optimization problem. Eventually, we are planning on replacing the regularized version with the dual also.

Transition Matrices

We also have a matrix regression solver built with cvxpy. We've used this for our primary election model and analysis. The transitions it generates form the transitions displayed in our sankey diagrams.

Development

We welcome contributions to this repo. Please open a Github issue for any issues or comments you have.

Set up a virtual environment and run:

> pip install -r requirements.txt
> pip install -r requirements-dev.txt 

Precommit

To run pre-commit for linting, run:

pre-commit run --all-files

Testing

> tox

Metadata

Release files for elex-solver 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elex-solver 2.1.1
File Size Uploaded Provenance Actions
elex_solver-2.1.1.tar.gz 25.8 kB Without provenance Details for elex_solver-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for elex-solver 2.1.1
File Interpreter ABI Platform Actions
elex_solver-2.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for elex_solver-2.1.1-py2.py3-none-any.whl

Total release size: 36.1 kB

Release files / elex_solver-2.1.1.tar.gz

Download URL elex_solver-2.1.1.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
75e8e986905738258136009d068b08a6a965a9bd56a4ae14ae80d7e8bb46a269
BLAKE2b-256 checksum
How to use checksums
19d8a0ad0127a46b971276d874e2115269b4361340d35ac2df68cc51c8d66652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / elex_solver-2.1.1-py2.py3-none-any.whl

Download URL elex_solver-2.1.1-py2.py3-none-any.whl
Size 10.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e73afaef8472339c0f1932adf7c4b5af4cca7c6a565ad0a4ad48d745e9f84645
BLAKE2b-256 checksum
How to use checksums
5286fd1b0617e11fd5fd34513fd2e297186a864371fe41af3d6f8068fb8af7c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for elex-solver 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page