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 solver for transition matrices. While this works arbitrarily, we have used this in the past for our primary election night model. We can still use this to create the sankey diagram coefficients.

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.0.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

elex_solver-2.0.1-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for elex-solver-2.0.1.tar.gz
Algorithm Hash digest
SHA256 952815ff680ee9ac58c909785186543513140ae0f8a28db051467ed58e4b4290
MD5 6aa470fd7c648ac904044b8c27f230f1
BLAKE2b-256 b57bd9100873badbf283490488b9e14b50aa83e3deefe07939e27225e09090c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elex_solver-2.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 58cb829e2cbf09497eb9ef0417b7508954fca36df1437fece5d7e6a85a55c575
MD5 e708b6802b60a57d0db639a99a3934b0
BLAKE2b-256 4f3e6316a6f1f6d06b73e0310f8de839ef8a3a5758dff7173bae9f918dce30f6

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