Regression workflows package based on Least Squares Regression and Quantile Regression.
Project description
Regressionizer
Python package with a class that allows pipeline-like specification and execution of regression workflows.
Extensive guide is given in the Jupyter notebook "Regressionizer-demo.ipynb".
Details
-
Regressionizer
allows for rapid and specification regression workflows.- To quickly specify:
- data rescaling and summary,
- regression computations,
- outliers finding
- conditional Cumulative Distribution Functions (CDFs) reconstruction
- visualization of data, fits, residual errors, outliers, CDFs
- To quickly specify:
-
Regressionizer
works with data frames, numpy arrays, and lists of numbers, and lists of numeric pairs. -
The curves computed with quantile regression are called regression quantiles.
-
Regressionizer
has three regression methods:quantile_regression
quantile_regression_fit
least_squares_fit
-
The regression quantiles computed with the method
quantile_regression
correspond to the specified probabilities- The regression quantiles are linear combinations of B-splines generated over the specified knots.
-
In other words, the method
quantile_regression
computes fits using a B-spline functions basis.- The basis is specified with the
knots
argument and the optionorder
. order
is 3 by default.
- The basis is specified with the
-
The methods
quantile_regession_fit
andleast_squares_fit
require a list of basis functions (to fit with.)
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 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Regressionizer-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84701a9161a81565085701881191fc145bb1fed45cb6c38169eabfde38c13758 |
|
MD5 | 9a8cdcf006231b4d29a7271f22653d91 |
|
BLAKE2b-256 | 2ddb543b07916c617c61faafeca90aa1cdffe33ffc3e4392ca88f0e74a038734 |