Regressionizer
Python package with a class that allows pipeline-like specification and execution of regression workflows.
Extensive guide is given in the Jupyter notebook "Rapid-specification-of-regression-workflows.ipynb" and the corresponding Markdown document "Rapid-specification-of-regression-workflows.md".
Features summary
-
The class
Regressionizerfacilitates rapid specifications of regressions workflows.- To quickly specify:
- data rescaling and summary
- regression computations
- outliers finding
- conditional Cumulative Distribution Functions (CDFs) reconstruction
- plotting of data, fits, residual errors, outliers, CDFs
- To quickly specify:
-
Regressionizerworks with data frames, numpy arrays, lists of numbers, and lists of numeric pairs.
Details and arguments
-
The curves computed with Quantile Regression are called regression quantiles.
-
Regressionizerhas three regression methods:quantile_regressionquantile_regression_fitleast_squares_fit
-
The regression quantiles computed with the methods
quantile_regressionandquantile_regression_fitcorrespond to probabilities specified with the argumentprobs. -
The method
quantile_regressioncomputes fits using a B-spline functions basis.- The basis is specified with the arguments
knotsandorder. orderis 3 by default.
- The basis is specified with the arguments
-
The methods
quantile_regession_fitandleast_squares_fituse lists of basis functions to fit with specified with the argumentfuncs.
Workflows flowchart
The following flowchart summarizes the workflows that are supported by Regressionizer:
Usage examples
Import libraries:
from Regressionizer import *
import numpy as np
Generate random data:
np.random.seed(0)
x = np.linspace(0, 2, 300)
y = np.sin(2 * np.pi * x) + np.random.normal(0, 0.4, x.shape)
data = np.column_stack((x, y)
Compute quantile regression for probabilities [0.2, 0.5, 0.8] and make the corresponding plot:
obj = (Regressionizer(data)
.quantile_regression(knots=8, probs=[0.2, 0.5, 0.8])
.plot(title="B-splines fit", template="plotly")
)
Show the plot obtained above:
obj.take_value().show()
References
Articles, books
[RK1] Roger Koenker, Quantile Regression, Cambridge University Press, 2005.
[RK2] Roger Koenker, "Quantile Regression in R: a vignette", (2006), CRAN.
[AA1] Anton Antonov, "A monad for Quantile Regression workflows", (2018), MathematicaForPrediction at GitHub.
Packages, paclets
[RKp1] Roger Koenker,
quantreg,
CRAN.
[AAp1] Anton Antonov, Quantile Regression WL paclet, (2014-2023), GitHub/antononcube.
[AAp2] Anton Antonov, Monadic Quantile Regression WL paclet, (2018-2024), GitHub/antononcube.
[AAp3] Anton Antonov,
QuantileRegression,
(2019),
Wolfram Function Repository.
Repositories
[AAr1] Anton Antonov, DSL::English::QuantileRegressionWorkflows in Raku, (2020), GitHub/antononcube.
Videos
[AAv1] Anton Antonov, "Boston useR! QuantileRegression Workflows 2019-04-18", (2019), Anton Antonov at YouTube.
[AAv2] Anton Antonov, "useR! 2020: How to simplify Machine Learning workflows specifications", (2020), R Consortium at YouTube.
Release files for Regressionizer 0.1.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 | |
|---|---|---|---|
| regressionizer-0.1.9.tar.gz | 24.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Regressionizer-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.4 kB
Release files / regressionizer-0.1.9.tar.gz
| Download URL | regressionizer-0.1.9.tar.gz |
|---|---|
| Size | 24.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75009e04708f22bbd738ac1e3b32ad1bdc900a8fac1a6017b9f7a30dc38dd41d
|
|
BLAKE2b-256 checksum How to use checksums |
ea3d8062cee8b68346a964224e8338283fca81930cb9a7ea3121a47a65490b7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.2
|
Release files / Regressionizer-0.1.9-py3-none-any.whl
| Download URL | Regressionizer-0.1.9-py3-none-any.whl |
|---|---|
| Size | 22.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed487784ce58b783e21ff91bb92c74555c20a4bc14a577e70fdf2352dd876737
|
|
BLAKE2b-256 checksum How to use checksums |
852903dcdf644298616c61ace4fb28961125c2ab422d6e4c285876b93142744b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.2
|