nemreg
A lightweight regression framework built on top of SciPy.
nemreg is designed to make regression analysis structured, compact, and easy to use — without sacrificing flexibility.
It wraps scipy.optimize.curve_fit in a clean scientific workflow that includes dataset handling, statistics, summaries, and plotting.
Install nemreg
install nemreg
Why nemreg?
SciPy is extremely powerful — but low-level.
With SciPy alone, you must manually:
- Prepare data shapes
- Compute residuals
- Compute R² / RMSE / χ²
- Handle uncertainties
- Write plotting code
- Structure outputs
nemreg provides this structure for you.
import nemreg as nr
ds = nr.Dataset(x, y, yerr=1.0)
res = nr.fit(ds, nr.models.linear())
nr.plot(mode="result_data", dataset=ds, result=res)
That’s it.
Features
- Clean
Datasetabstraction (1D and multivariable) - Weighted and unweighted regression
- Automatic statistics:
- R²
- RMSE
- χ²
- Reduced χ²
- Structured
FitResultobject - Built-in plotting dispatcher
- Built-in models (linear, polynomial, etc.)
- Support for replicated measurements
- Clean summary output
- Multivariable regression support
Installation
Clone the repository and install dependencies:
pip install numpy scipy matplotlib
Optional:
pip install pytest jupyter
Then install nemreg (editable mode recommended):
pip install -e .
Quick Start
import numpy as np
import nemreg as nr
x = np.linspace(-5, 5, 40)
y = 2.5*x - 1 + np.random.normal(0, 1, size=x.size)
ds = nr.Dataset(x=x, y=y)
res = nr.fit(ds, nr.models.linear())
nr.plot(mode="result_data", dataset=ds, result=res)
Project Philosophy
nemreg is not meant to replace SciPy.
It is meant to:
- Reduce boilerplate
- Encourage structured analysis
- Improve readability
- Make regression workflows easier to teach and share
SciPy remains the optimization engine under the hood.
Note from the Author
This library is intended for free use and free sharing, as it was created in the spirit of making regression easier for everyone.
Please refer to the LICENCE file for details on usage, modification, and redistribution.
The author strongly recommends browsing through the nemreg_demo.ipynb file.
It allows you to:
- Verify dependencies
- Confirm your environment works correctly
- See example workflows
- Explore available commands
Planned Features
- LaTeX export for automatic report generation
- Native Levenberg–Marquardt (LM) core implementation, trying to improve the regression capabilities on more complex functions
- Additional diagnostics (influence, leverage, etc.)
- Robust fitting / outlier handling
- Extended model library
- Improved multivariable visualization
License
See the LICENCE file for full details.
Contributing
Contributions, suggestions, and improvements are welcome.
Please open an issue or submit a pull request.
Acknowledgements
Built on top of:
- NumPy
- SciPy
- Matplotlib
These libraries power the numerical engine behind nemreg.
Metadata
Release files for nemreg 0.1.0
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 |
|---|---|---|---|---|
| nemreg-0.1.0.tar.gz | 37.1 kB | Without provenance | Details for nemreg-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nemreg-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nemreg-0.1.0-py3-none-any.whl |
Total release size: 88.9 kB
Release files / nemreg-0.1.0.tar.gz
| Download URL | nemreg-0.1.0.tar.gz |
|---|---|
| Size | 37.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a560f9d4da5d18147f3b5046e113865f6f19ed8d0a854250de63d3ec10aa466
|
|
BLAKE2b-256 checksum How to use checksums |
ba9e2749d82ee12416556abeb870b4f7b9c9cb7f57ae36c6dbbcfe1dbfe09f1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / nemreg-0.1.0-py3-none-any.whl
| Download URL | nemreg-0.1.0-py3-none-any.whl |
|---|---|
| Size | 51.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40347b07a02e6e49267aac592ed361b3e4433dab3cd1876132620ff039340b47
|
|
BLAKE2b-256 checksum How to use checksums |
a3a73ef46bc615b75d210331ce4a80d5e49a8761cec3ccbba367a45dedf90335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for nemreg 0.1.0
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.