Skip to main content

An open source python library for non-linear piecewise symbolic regression based on Genetic Programming

Project description

PS-Tree

https://img.shields.io/pypi/v/pstree.svg https://img.shields.io/travis/hengzhe-zhang/pstree.svg Documentation Status

An open source python library for non-linear piecewise symbolic regression based on Genetic Programming

Introduction

Piece-wise non-linear regression is a long-standing problem in the machine learning domain that has long plagued machine learning researchers. It is extremely difficult for users to determine the correct partition scheme and non-linear model when there is no prior information. To address this issue, we proposed piece-wise non-linear regression tree (PS-Tree), an automated piece-wise non-linear regression method based on decision tree and genetic programming techniques. Based on such an algorithm framework, our method can produce an explainable model with high accuracy in a short period of time.

Installation

pip install -U pstree

Features

  • A fully automated piece-wise non-linear regression tool

  • A fast genetic programming based symbolic regression tool

Example

An example of usage:

X, y = load_diabetes(return_X_y=True)
x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
r = PSTreeRegressor(regr_class=GPRegressor, tree_class=DecisionTreeRegressor,
                    height_limit=6, n_pop=25, n_gen=100,
                    basic_primitive='optimal', size_objective=True)
r.fit(x_train, y_train)
print(r2_score(y_test, r.predict(x_test)))

Experimental results on SRBench:

https://raw.githubusercontent.com/hengzhe-zhang/PS-Tree/master/docs/R2-result.png

Citation

@article{zhang2022ps,
    title={PS-Tree: A piecewise symbolic regression tree},
    author={Zhang, Hengzhe and Zhou, Aimin and Qian, Hong and Zhang, Hu},
    journal={Swarm and Evolutionary Computation},
    volume={71},
    pages={101061},
    year={2022},
    publisher={Elsevier}
}

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2021-06-28)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pstree-0.1.2.tar.gz (101.3 kB view details)

Uploaded Source

Built Distribution

pstree-0.1.2-py2.py3-none-any.whl (26.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pstree-0.1.2.tar.gz.

File metadata

  • Download URL: pstree-0.1.2.tar.gz
  • Upload date:
  • Size: 101.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pstree-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2441283a82c5d05da66b0167f67a3a7fb6c97ceb7e92e70db1593a3faeb40bc8
MD5 02bd1607087d1702078e7b8602b694fe
BLAKE2b-256 b8439a196069b575e59102d9f830dbda8ef87701d5e4679405320b91f31cb3fa

See more details on using hashes here.

File details

Details for the file pstree-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: pstree-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pstree-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a53ce98b0e82dc793c49503b69fe6b560b1b15a932480262a5a4664dae966b89
MD5 e70be35a67e8347a3e62703ed5c9b25c
BLAKE2b-256 66ee6dbdd153cbadd241c7944b662b18e4e27be3c337bbdb7842c0fd76a67cdb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page