Iimplementation of TMPNN, tabular polynomial network.
Project description
TMPNN: High-Order Polynomial Regression Based on Taylor Map Factorization
This is a Tensorflow implementation of TMPNN, tabular polynomial network. TMPNN maps internal dynamical system with lower order polynomial and integrate it, resulting in high-order polynomial model with low complexity.
Example
The default usage:
from tmpnn import TMPNNRegressor, TMPNNLogisticRegressor, TMPNNClassifier, TMPNNPLTransformer
tmpnn = TMPNNRegressor(random_state=0)
tmpnn.fit(x, y)
pred = tmpnn.predict(x)
score = tmpnn.score(x, y)
However, in most cases you should scale x and optionally y:
from sklearn.compose import TransformedTargetRegressor
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import MinMaxScaler
tmpnn = TransformedTargetRegressor(
regressor=Pipeline([
('mms', MinMaxScaler((-0.5,0.5))),
('est', TMPNNRegressor(random_state=0))
]),
transformer=MinMaxScaler((-0.5,0.5))
)
TMPNN is sklearn-friendly, so you also can use it with cross validation or parameter search:
cv_scores = cross_val_score(tmpnn, x, y)
Hyperparameters
TMPNN has two major parameters:
degree
: polynomial order of the Taylor Map. Default value is 2.
steps
: number of iterations of applying the Taylor Map, integration steps alternatevily. Default value is 7, it might be helpful to search from 2 to 10 for each speciefic task.
In case of small datasets (n_samples < 1000
) one can also tune regularizer
. All tensorflow regularizers and lyapnuov (tmpnn.Lyapunov()
) are acceptable. Lyapunov regularizer tend to provide models robust to extra noise.
For larger datasets one can increase number of optimization epochs max_epochs
. Default value is 100.
Citation
If you use this library for a scientific publication, please use the following BibTex entry to cite our work:
@misc{ivanov2023tmpnn,
title={TMPNN: High-Order Polynomial Regression Based on Taylor Map Factorization},
author={Andrei Ivanov and Stefan Maria Ailuro},
year={2023},
eprint={2307.16105},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
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
File details
Details for the file tmpnn-0.0.3.tar.gz
.
File metadata
- Download URL: tmpnn-0.0.3.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75d0303020257aa1e5f5e28d844499d6365ee6b4495812fee1455fa3a90d91fa |
|
MD5 | 3b048de48b99f49356a07ae45338be1e |
|
BLAKE2b-256 | be0fa973d36d2c120a5cf2e9bf6b359ee68d75d0811e4a641a5f1daa11b63d1a |
File details
Details for the file tmpnn-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: tmpnn-0.0.3-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 759cb380f9f931933f393afcde67e02e3ecf2f1cbdcc29d85fd600e113be4743 |
|
MD5 | ecb34efc776a753458588405715e2d0a |
|
BLAKE2b-256 | c6aed7d82d081c9b176deea9a93d2fb6c76e4c5c5691006087984a19b1f83792 |