Skip to main content

Python bindings for the Ensmallen library.

Project description

pyensmallen_experimental: python bindings for the ensmallen library for numerical optimization

This is a fork of the pyensmallen repo for experimental purposes.

Lightweight python bindings for ensmallen library. Currently supports

  • L-BFGS, with intended use for optimisation of smooth objectives for m-estimation
  • ADAM (and variants with different step-size routines) - makes use of ensmallen's templatization.
  • Frank-Wolfe, with intended use for constrained optimization of smooth losses
    • constraints are either lp-ball (lasso, ridge, elastic-net) or simplex
  • (Generalized) Method of Moments estimation with ensmallen optimizers.
    • this uses ensmallen for optimization [and relies on jax for automatic differentiation to get gradients and jacobians]. This is the main use case for pyensmallen and is the reason for the bindings.

See ensmallen docs for details. The notebooks/ directory walks through several statistical examples.

speed

pyensmallen is very fast. A comprehensive set of benchmarks is available in the benchmarks directory. The benchmarks are run on an intel 12th gen framework laptop. Benchmarks vary data size (sample size and number of covariates) and parametric family (linear, logistic, poisson) and compare pyensmallen with scipy and statsmodels (I initially also tried to keep cvxpy in the comparison set but it was far too slow to be in the running). At large data sizes, pyensmallen is roughly an order of magnitude faster than scipy, which in turn is an order of magnitude faster than statsmodels. So, a single statsmodels run takes around as long as a pyensmallen run that naively uses the nonparametric bootstrap for inference. This makes the bootstrap a viable option for inference in large data settings.

Installation:

Make sure your system has blas installed. On macos, this can be done via brew. Linux systems should have it installed by default. If you are using conda, you can install blas via conda-forge.

Then,

from pypi

pip install pyensmallen

from source

  1. Install armadillo and ensmallen for your system (build from source, or via conda-forge; I went with the latter)
  2. git clone this repository
  3. pip install -e .
  4. Profit? Or at least minimize loss?

from wheel

  • download the appropriate .whl for your system from the more recent release listed in Releases and run pip install ./pyensmallen... OR
  • copy the download url and run pip install https://github.com/apoorvalal/pyensmallen/releases/download/<version>/pyensmallen-<version>-<pyversion>-linux_x86_64.whl

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

pyensmallen_experimental-0.2.7128.tar.gz (3.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyensmallen_experimental-0.2.7128-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pyensmallen_experimental-0.2.7128-cp312-cp312-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyensmallen_experimental-0.2.7128-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyensmallen_experimental-0.2.7128-cp311-cp311-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyensmallen_experimental-0.2.7128-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyensmallen_experimental-0.2.7128-cp310-cp310-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file pyensmallen_experimental-0.2.7128.tar.gz.

File metadata

File hashes

Hashes for pyensmallen_experimental-0.2.7128.tar.gz
Algorithm Hash digest
SHA256 110623edf0f6845b7a1ffcb5605f3981d04940199307c58887de7967a741e850
MD5 b6c3f18c2db2548c25f0b57e276b4e63
BLAKE2b-256 4fe91ef6b7405a17dc9220ee8c4c4afbc6ebdd837c035b066d0542bb3c7ec7e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyensmallen_experimental-0.2.7128.tar.gz:

Publisher: build.yml on gauravmanmode/pyensmallen_experimental

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyensmallen_experimental-0.2.7128-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyensmallen_experimental-0.2.7128-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c1762fc606a081c27ade70f8e175f017539cc8ab9825bfe1ada7d81c860c476
MD5 a592ae8d556e198cf1c4699c293e40c2
BLAKE2b-256 fa89b226f013810f1eb2a540719e18f432ba79c4c8f1847baaaf626839dc2143

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyensmallen_experimental-0.2.7128-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on gauravmanmode/pyensmallen_experimental

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyensmallen_experimental-0.2.7128-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyensmallen_experimental-0.2.7128-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df313d00abf0da0a9cc15eaa86a224102c691afa2d322bc822fe07ce98578f09
MD5 13667299344fabae1137715fb092fce7
BLAKE2b-256 bc4b31f13cbeae8395673c63ea67e956a7fa243437d2e018cfb7cb4cb6420bd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyensmallen_experimental-0.2.7128-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build.yml on gauravmanmode/pyensmallen_experimental

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyensmallen_experimental-0.2.7128-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyensmallen_experimental-0.2.7128-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f905d29362365f47ea4f8090f69edc5575e1b75f4686bacd26aa0dbe58e22feb
MD5 bc78b8152db35052c17e123513f4b6a7
BLAKE2b-256 28756b27b52621c280c6b9be8198ef9e19ac049247f6a56238fb0fb90cc12d29

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyensmallen_experimental-0.2.7128-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on gauravmanmode/pyensmallen_experimental

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyensmallen_experimental-0.2.7128-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyensmallen_experimental-0.2.7128-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53d6b71b68e6af709e204d4541a00ee5fdbd8eb2b2e398cffc74c0c0c992af42
MD5 b147f30f0c33954ece3e749ec02d97d4
BLAKE2b-256 66a4d6eec20f1730c4b4bd4968ac917bf58300c8c47e0efea4d43f7d6c4c45d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyensmallen_experimental-0.2.7128-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build.yml on gauravmanmode/pyensmallen_experimental

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyensmallen_experimental-0.2.7128-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyensmallen_experimental-0.2.7128-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 adf09a77be3dfdd2ea04712958e7a87965d0e387f285813da0d89bc5e469043b
MD5 d43d0e7ebde4e2ea3318efbf2385f1c1
BLAKE2b-256 bea0940339b8237080140185ef20d33851295ad11929aa6a570fb3328fb297d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyensmallen_experimental-0.2.7128-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on gauravmanmode/pyensmallen_experimental

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyensmallen_experimental-0.2.7128-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyensmallen_experimental-0.2.7128-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 653cd863f50791b3e417a926115dd3dddd62a2495d4f46337555c0c81db71428
MD5 3f7e329720f7d9c82d2d36482f0a553a
BLAKE2b-256 5b03b862b926093b1e7765b25568bc321f1372474d58d727b1695e8c3b22648d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyensmallen_experimental-0.2.7128-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build.yml on gauravmanmode/pyensmallen_experimental

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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