regressor
This is a small library that tries to run simple linear regression quickly on modern x86 hardware. This uses vectorized operations to speed up calculating dot products and means. The input numpy arrays need to be 1D with 32-bit floats.
As a result, this is ~20X faster than scipy.stats.linregress, but only runs on x86-64 hardware with AVX extensions (most desktops and servers as of 2020).
Install
pip install regressor
Usage
>>> import numpy as np
>>> from regressor import linregress
>>> x = np.array([1.0, 2.0, 3.0, 4.0, 5.0], dtype=np.float32)
>>> y = np.array([5.0, 4.0, 3.0, 2.0, 1.0], dtype=np.float32)
>>> linregress(x, y)
LinregressResult(slope=-1.0, intercept=6.0, rvalue=-1.0, pvalue=1.2e-30, stderr=0.0)
Performance
The graph below compares the times required for simple linear regressions between this package and scipy.stats.linregress, starting from arrays with 10 elements up to arrays with 100 million elements. This was run on a 2.6 GHz Skylake CPU. In general, this package performs simple linear regression in about 1/20th of the time required by scipy.stats.linregress.
Reliability
The regression results from this package match scipy.stats.linregress to within 4 decimal places (for the slope, intercept, r-value, p-value and standard error). The graphs below demonstrate this consistency by comparing betas, r-values and p-values from this package vs scipy.stats.linregress. These used randomly sampled values with varying correlation between the X and Y arrays to assess reliability across a wide range of P-values.
Metadata
Release files for regressor 1.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| regressor-1.0.9.tar.gz | 181.6 kB | Details |
Built distributions (wheels)
Total release size: 4.3 MB
Release files / regressor-1.0.9.tar.gz
| Download URL | regressor-1.0.9.tar.gz |
|---|---|
| Size | 181.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd4d13f20ecb1c8d489ff017d0d339c905f36d9da612cfd663eb88e094f6efa1
|
|
BLAKE2b-256 checksum How to use checksums |
b4eac2c9a87bef9925f2ce5c19716b014350aa73bf0202d3f52d4fda2177d3be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp312-cp312-win_amd64.whl
| Download URL | regressor-1.0.9-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 99.9 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9e3af9eb41484f0d351ff3f907f1325f557bb2f2357ca284e6e169a4c9118d0e
|
|
BLAKE2b-256 checksum How to use checksums |
d444c307046870a39bf3d43cb2d5d9bac27493ce436c7b903a731ab7e44bf511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | regressor-1.0.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 653.9 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
772194f324b9c495f6fed9e34126fcf1ad62a502dca30207619b58dc849e8c29
|
|
BLAKE2b-256 checksum How to use checksums |
c121503fb81057c98485e7c8d8e54df244bf7ba6526424c45b1547b9566b20a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | regressor-1.0.9-cp312-cp312-macosx_10_9_x86_64.whl |
|---|---|
| Size | 120.0 kB |
| Tags | CPython 3.12 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
4e0baee6fd611ae937b9de7b18cd517ff5a11c458c454cfead5b596f81a51775
|
|
BLAKE2b-256 checksum How to use checksums |
44395b2bbdc489915cb0f00659204fcbfe3fdc257593aaf90be1d6ca552e9213
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp311-cp311-win_amd64.whl
| Download URL | regressor-1.0.9-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 102.2 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
821770b3a7ea562f2db2f0336b755d3167d5cbeebfd25a4d2e36dbc69bb4beda
|
|
BLAKE2b-256 checksum How to use checksums |
a8b30ca7bc275a35cdbdc1ed0670ea333ab36a2cc9aa165d6612700ae86f7849
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | regressor-1.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 614.2 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
70cda3cfbb9303fde92d4d83381304fd13e0b99839e2328bee63845108d98049
|
|
BLAKE2b-256 checksum How to use checksums |
7e950c8d633760441408ea760699a92e2c35f1b0636bd7e4a51ed8b56a3e8eb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | regressor-1.0.9-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 121.7 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
67de2eb8d4174911956bc071077a7f65062ec0c41829d4a95849c564a458c026
|
|
BLAKE2b-256 checksum How to use checksums |
abceb7643791dea23008f81ee82b971790821834e8346b6bb39dd9d09b88cb27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp310-cp310-win_amd64.whl
| Download URL | regressor-1.0.9-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 102.2 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1f4d9310c0573ca37dd0ec988ae000cb731af51a36ca47e8b67a8461c0abc23a
|
|
BLAKE2b-256 checksum How to use checksums |
69eb57f260a85f3d00709cfa588cfc2b79eecc904cfdfec755970e2fd7fa0bd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | regressor-1.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 578.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d0fccb6e9672310253713e2683ca02a97765b5edee1bc926034ff4208634eeb2
|
|
BLAKE2b-256 checksum How to use checksums |
7e60e3a05be15723c7cf75388a7e3da7b0cb5ce6a49fda17d0e2e351c987dbd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | regressor-1.0.9-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 121.7 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
1a54d5ac25f54c82deaf526f1451c1e070ddbf873b3625ec9c11158e110940c2
|
|
BLAKE2b-256 checksum How to use checksums |
49b9b1e34c7e93212e50183c0235e8c52cf77f10c4d49033d0fbae57524e30c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp39-cp39-win_amd64.whl
| Download URL | regressor-1.0.9-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 102.3 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
68dc3de38e7ed93a0975a12fe9d47e1ae41eb19179cd7c176825813d23ce5c87
|
|
BLAKE2b-256 checksum How to use checksums |
0ef7b7ee78e0be1bc229d1c040ee2a09d61418644457bb0e5b2b4c4a24b2460a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | regressor-1.0.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 578.8 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b8e19196efb2febf1188cdd16a3117664fc7543ef88bc4b385fe50ecfeb7a2d6
|
|
BLAKE2b-256 checksum How to use checksums |
422b009200d379ca781284ae1abca71a026173d76d6abc5c5341303df54d0664
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | regressor-1.0.9-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 122.1 kB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
9dcbfe96a26dd361aa96966c2a4642c297b908651f70fe4d332cb2d219ac8cee
|
|
BLAKE2b-256 checksum How to use checksums |
59b94c16cb810005b2eb8a8d7ae55793381b18bcc9a4086cded0114fb1581be4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp38-cp38-win_amd64.whl
| Download URL | regressor-1.0.9-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 102.4 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2dc72be4b36f1913b135cdf465c5e364882d63bf5f1dd19e708b91d6b44fbecf
|
|
BLAKE2b-256 checksum How to use checksums |
6d06b1a74f54b4f6d4c85d023b41371cee65dcf3b6ea4035abc8c3c6eb244b61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | regressor-1.0.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 594.3 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
83379a1634bd8f362ff6d7cea66f35984b472d8e518083056c2fae7ff4b9229e
|
|
BLAKE2b-256 checksum How to use checksums |
459e9beebc3beaca512deaacd811c41146739c68ed5ca2025a2f5e6df283fa0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / regressor-1.0.9-cp38-cp38-macosx_10_9_x86_64.whl
| Download URL | regressor-1.0.9-cp38-cp38-macosx_10_9_x86_64.whl |
|---|---|
| Size | 121.6 kB |
| Tags | CPython 3.8 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
75a18a17acaa5fd8bc8756a346923f7d7d3ed075605821990c1111c8b7a108c1
|
|
BLAKE2b-256 checksum How to use checksums |
0b22ded9b4ea6b2003bbbdf8327049352b4a347aba72e8a395b71dddba38d997
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|