Skip to main content

A package for optimization solvers

Project description

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

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

elex-solver-2.1.0.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

elex_solver-2.1.0-py2.py3-none-any.whl (10.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file elex-solver-2.1.0.tar.gz.

File metadata

  • Download URL: elex-solver-2.1.0.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for elex-solver-2.1.0.tar.gz
Algorithm Hash digest
SHA256 7d01019d41183b773b1bfd425eca5829d3d843aca9054d521a9d5cf57427b12d
MD5 20ea2672027f12f05918bf80767dfa9c
BLAKE2b-256 4eec608017dd82f8830e998af3db84f4707caadcd24fa7ef179a056cdbd2178f

See more details on using hashes here.

File details

Details for the file elex_solver-2.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for elex_solver-2.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2bd22e176075c0b1c6909e21b816a285f91ce9f82928db75d7222a48dc4a670f
MD5 22178ad6d3985a7447f8bf2aedd1c8ad
BLAKE2b-256 eca1e3d05fa4ae6e737f60c305abdcfc56fc9fdcb256dbde1cfbbda692c6689e

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