CvxFit
CvxFit is a package which provides classes for fitting convex functions to given data.
Usage
Typical usage looks like this:
#!/usr/bin/env python
from cvxfit import CvxFit
import scipy as sp
# Generate data.
N = 1000
n = 3
def f_actual(x):
return sp.sum(x*x)
X = sp.randn(N, n)
Y = sp.array([f_actual(pt) for pt in X])
# Initialize object with 10 affine functions
# with regularization 0.001, and maximum
# number of iterations 20.
fit_object = CvxFit(X=X, Y=Y, type='pwl', extra_param=[10, 0.001, 20])
# Perform fit.
fit_object.fit()
# See training error; repeat fit if high.
print 'Training error: ' + str(fit_object.mean_training_error)
# Compare quality of fit at a random point.
pt = sp.randn(1, n)
print 'Actual value: ' + str(f_actual(pt))
print 'Approximate value: ' + str(fit_object.evaluate(pt)[0])
Authors
This package was originally written and tested by Mainak Chowdhury, Alon Kipnis and Milind Rao.
Acknowledgements
This package came out of a course project for EE364b at Stanford University, Spring 2014, taught by Prof. Stephen Boyd. We would like to thank all members of the awesome teaching staff for their feedback and suggestions.
Metadata
Release files for cvxfit 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cvxfit-0.1.10.tar.gz | 7.4 kB | Without provenance | Details for cvxfit-0.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cvxfit-0.1.10-py3-none-any.whl | Python 3 | none | any | Details for cvxfit-0.1.10-py3-none-any.whl |
Total release size: 15.1 kB
Release files / cvxfit-0.1.10.tar.gz
| Download URL | cvxfit-0.1.10.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7206b1563caa804fba2d4ca0a3d59b67ad99f31ecfa711d10b26b39e7fbd90b8
|
|
BLAKE2b-256 checksum How to use checksums |
f8a8253b1a64d582459f1f36072014c21a71340b3da6977c4aace14590cce1c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / cvxfit-0.1.10-py3-none-any.whl
| Download URL | cvxfit-0.1.10-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
600935ce155f536a21744b409fa7145af036a1b2073be1d53a59283fa47bc47d
|
|
BLAKE2b-256 checksum How to use checksums |
fe97a8d3dc22796ec13a7b1259ce152d3a5096970bd173cd4d95a8a70836eade
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for cvxfit 0.1.10
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.