Chebyshev polynomial feature expansion and regression for scikit-learn
Project description
poly-basis-ml
Chebyshev polynomial feature expansion and regression for scikit-learn.
Installation
pip install poly-basis-ml
Quick start
from poly_basis_ml import ChebyshevRegressor
from sklearn.datasets import make_friedman1
from sklearn.model_selection import train_test_split
X, y = make_friedman1(n_samples=1000, random_state=42)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)
model = ChebyshevRegressor(complexity=5, alpha=0.1)
model.fit(X_train, y_train)
print(f"R2: {model.score(X_test, y_test):.3f}")
Key features
- ChebyshevExpander --- standalone sklearn transformer for polynomial feature expansion
- ChebyshevRegressor --- convenience estimator wrapping Chebyshev expansion + Ridge
- ChebyshevModelTreeRegressor --- decision tree with Chebyshev polynomial leaf models
- Bivariate interactions --- optional product, contrast, and additive interaction features
How it works
Features are mapped to [-1, 1] via MinMaxScaler, then expanded into Chebyshev polynomial basis functions with proper intercept handling (one T0 term retained, redundant constant columns stripped). The resulting design matrix is fitted with Ridge regression. For the model tree variant, a decision tree first partitions the data into regions, then each leaf fits a separate ChebyshevRegressor for smooth local approximation.
Main classes
ChebyshevRegressor
| Parameter | Default | Description |
|---|---|---|
complexity |
5 |
Chebyshev polynomial degree |
alpha |
1.0 |
Ridge regularisation strength |
clip_input |
True |
Clip prediction-time inputs to training range |
include_interactions |
False |
Add bivariate interaction features |
ChebyshevModelTreeRegressor
| Parameter | Default | Description |
|---|---|---|
max_depth |
3 |
Maximum depth of routing tree |
min_samples_leaf |
200 |
Minimum samples per leaf for polynomial fit |
complexity |
2 |
Chebyshev degree for leaf models |
alpha |
10.0 |
Ridge regularisation for leaf models |
Citation
@article{gerber2026revisiting,
title={Revisiting Chebyshev Polynomial and Anisotropic RBF Models for Tabular Regression},
author={Gerber, Luciano and Lloyd, Chris},
year={2026}
}
Licence
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file poly_basis_ml-0.1.0.tar.gz.
File metadata
- Download URL: poly_basis_ml-0.1.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94e10e0012b9c84ff42332baf2d58aacedb9d3726337df9c66315fc473681187
|
|
| MD5 |
ebc2c0b99d7ed39651f0a965d32a37d0
|
|
| BLAKE2b-256 |
8f090e09d9c2694b06ae5835db2269830e092e577a06c8b7f9dacbb396b4b3fe
|
Provenance
The following attestation bundles were made for poly_basis_ml-0.1.0.tar.gz:
Publisher:
publish.yml on gerberl/poly-basis-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
poly_basis_ml-0.1.0.tar.gz -
Subject digest:
94e10e0012b9c84ff42332baf2d58aacedb9d3726337df9c66315fc473681187 - Sigstore transparency entry: 906442476
- Sigstore integration time:
-
Permalink:
gerberl/poly-basis-ml@bf3fd913162f90cc489c9dba887c1a2e053c3fba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gerberl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bf3fd913162f90cc489c9dba887c1a2e053c3fba -
Trigger Event:
push
-
Statement type:
File details
Details for the file poly_basis_ml-0.1.0-py3-none-any.whl.
File metadata
- Download URL: poly_basis_ml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
989dad888097c88288fc4e182f87486d9f010a5ec232c8ffc74c2b2d688303ad
|
|
| MD5 |
b8932bc21cb0a2345f9f9ec4f10ffc9c
|
|
| BLAKE2b-256 |
8095efa69eaf5133074ea1793b9b2a590574f3820bf913a0a8502891c0695376
|
Provenance
The following attestation bundles were made for poly_basis_ml-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on gerberl/poly-basis-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
poly_basis_ml-0.1.0-py3-none-any.whl -
Subject digest:
989dad888097c88288fc4e182f87486d9f010a5ec232c8ffc74c2b2d688303ad - Sigstore transparency entry: 906442524
- Sigstore integration time:
-
Permalink:
gerberl/poly-basis-ml@bf3fd913162f90cc489c9dba887c1a2e053c3fba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gerberl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bf3fd913162f90cc489c9dba887c1a2e053c3fba -
Trigger Event:
push
-
Statement type: