Python bindings for the Ensmallen library.
Project description
pyensmallen: python bindings for the ensmallen library for numerical optimization
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
jaxfor automatic differentiation to get gradients and jacobians]. This is the main use case forpyensmallenand is the reason for the bindings.
- this uses ensmallen for optimization [and relies on
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
- Install
armadilloandensmallenfor your system (build from source, or via conda-forge; I went with the latter) - git clone this repository
pip install -e .- Profit? Or at least minimize loss?
from wheel
- download the appropriate
.whlfor your system from the more recent release listed inReleasesand runpip 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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyensmallen-0.3.2.tar.gz.
File metadata
- Download URL: pyensmallen-0.3.2.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f2fab3c8220f45c4c8888517421ca51ef60c841bff141840b5068383090220a
|
|
| MD5 |
4b871f262754cbbb64f4b3d67e914a19
|
|
| BLAKE2b-256 |
be7e068fd25b0f5b61bf56c125bb29e1d9e6b6ba0c374e7af05d8f1bd2a61fcd
|
Provenance
The following attestation bundles were made for pyensmallen-0.3.2.tar.gz:
Publisher:
build.yml on apoorvalal/pyensmallen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyensmallen-0.3.2.tar.gz -
Subject digest:
1f2fab3c8220f45c4c8888517421ca51ef60c841bff141840b5068383090220a - Sigstore transparency entry: 314325278
- Sigstore integration time:
-
Permalink:
apoorvalal/pyensmallen@75184d919d06d6336a7bf9b679a434b950014902 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/apoorvalal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@75184d919d06d6336a7bf9b679a434b950014902 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyensmallen-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyensmallen-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 15.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05686150794900668503827aa91d9be138c3b9f68f49810010b5a48aba64aef2
|
|
| MD5 |
18a706f6fb0aae43dafc65f05db97f0b
|
|
| BLAKE2b-256 |
30fe46760f690ed1cad68084af6d4c4ac19de52d6bc723f7108ab8707f82c033
|
Provenance
The following attestation bundles were made for pyensmallen-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on apoorvalal/pyensmallen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyensmallen-0.3.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
05686150794900668503827aa91d9be138c3b9f68f49810010b5a48aba64aef2 - Sigstore transparency entry: 314325288
- Sigstore integration time:
-
Permalink:
apoorvalal/pyensmallen@75184d919d06d6336a7bf9b679a434b950014902 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/apoorvalal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@75184d919d06d6336a7bf9b679a434b950014902 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyensmallen-0.3.2-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyensmallen-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.4 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d10d72bf8f97141275789671136ae30c1930e4689428e51b7b0191d142984f72
|
|
| MD5 |
4600e8307f8f132ff24b7df86d7b2c8c
|
|
| BLAKE2b-256 |
b636693d9b40ce77eb5d7d4c3bd2b80b98b0f7045dde2cbcb331c3820fbf2ebe
|
Provenance
The following attestation bundles were made for pyensmallen-0.3.2-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
build.yml on apoorvalal/pyensmallen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyensmallen-0.3.2-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
d10d72bf8f97141275789671136ae30c1930e4689428e51b7b0191d142984f72 - Sigstore transparency entry: 314325280
- Sigstore integration time:
-
Permalink:
apoorvalal/pyensmallen@75184d919d06d6336a7bf9b679a434b950014902 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/apoorvalal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@75184d919d06d6336a7bf9b679a434b950014902 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyensmallen-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyensmallen-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 15.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6598c4126aae0b952e09362855d6cc18d1aaf48795225c5c8a15d4d14d988a11
|
|
| MD5 |
b023f25b5453ae6bbd29005d68911bfe
|
|
| BLAKE2b-256 |
1ec3d60ced0d39c8f48bd0a0eff3f31fe126e6958643fcb7e045e28a9742871d
|
Provenance
The following attestation bundles were made for pyensmallen-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on apoorvalal/pyensmallen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyensmallen-0.3.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
6598c4126aae0b952e09362855d6cc18d1aaf48795225c5c8a15d4d14d988a11 - Sigstore transparency entry: 314325290
- Sigstore integration time:
-
Permalink:
apoorvalal/pyensmallen@75184d919d06d6336a7bf9b679a434b950014902 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/apoorvalal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@75184d919d06d6336a7bf9b679a434b950014902 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyensmallen-0.3.2-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyensmallen-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.4 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40124056d342594cda74537ecd883090a045311e8219d3e4cba932e10b0abb33
|
|
| MD5 |
3abeda8833dffb2db7fc201aa17f0780
|
|
| BLAKE2b-256 |
64b74ab4183238307d11683180fad282bb65c515ff1615d4604f97d4c7bed849
|
Provenance
The following attestation bundles were made for pyensmallen-0.3.2-cp311-cp311-macosx_11_0_arm64.whl:
Publisher:
build.yml on apoorvalal/pyensmallen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyensmallen-0.3.2-cp311-cp311-macosx_11_0_arm64.whl -
Subject digest:
40124056d342594cda74537ecd883090a045311e8219d3e4cba932e10b0abb33 - Sigstore transparency entry: 314325285
- Sigstore integration time:
-
Permalink:
apoorvalal/pyensmallen@75184d919d06d6336a7bf9b679a434b950014902 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/apoorvalal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@75184d919d06d6336a7bf9b679a434b950014902 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyensmallen-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyensmallen-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 15.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28a35252f23b06104072b81e837d354b0be8e851d59025022f180bd4041315b8
|
|
| MD5 |
f3ca6f353bb036a1fdd2fedb76de2746
|
|
| BLAKE2b-256 |
cc64f73886b6237271f3b5bf84ccd3b03c59737d2455cb43e5708359e3c3a0ea
|
Provenance
The following attestation bundles were made for pyensmallen-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on apoorvalal/pyensmallen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyensmallen-0.3.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
28a35252f23b06104072b81e837d354b0be8e851d59025022f180bd4041315b8 - Sigstore transparency entry: 314325284
- Sigstore integration time:
-
Permalink:
apoorvalal/pyensmallen@75184d919d06d6336a7bf9b679a434b950014902 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/apoorvalal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@75184d919d06d6336a7bf9b679a434b950014902 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyensmallen-0.3.2-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyensmallen-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.4 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e74ba262fc7dfcb6ea9698dd9f7b7ed3fcdb0a12e77cf3062cd312e1a1ffe063
|
|
| MD5 |
1b0973110d3e1b2672ec5f8891d04c89
|
|
| BLAKE2b-256 |
6d956e35d48f91d92389c75dd94006ae628b424c03d4bec9249e0456806ac4f2
|
Provenance
The following attestation bundles were made for pyensmallen-0.3.2-cp310-cp310-macosx_11_0_arm64.whl:
Publisher:
build.yml on apoorvalal/pyensmallen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyensmallen-0.3.2-cp310-cp310-macosx_11_0_arm64.whl -
Subject digest:
e74ba262fc7dfcb6ea9698dd9f7b7ed3fcdb0a12e77cf3062cd312e1a1ffe063 - Sigstore transparency entry: 314325283
- Sigstore integration time:
-
Permalink:
apoorvalal/pyensmallen@75184d919d06d6336a7bf9b679a434b950014902 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/apoorvalal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@75184d919d06d6336a7bf9b679a434b950014902 -
Trigger Event:
push
-
Statement type: