Skip to main content

XGP Python package

PyPI version Travis build status Coverage Status

This repository contains Python bindings to the XGP library. It is a simple wrapper that calls the XGP dynamic shared library and exposes a scikit-learn interface.

Documentation

Please refer to the Python section of the XGP website.

Installation

Installation instructions are available here.

Quick start

>>> from sklearn import datasets
>>> from sklearn import metrics
>>> from sklearn import model_selection
>>> import xgp

>>> X, y = datasets.load_boston(return_X_y=True)
>>> X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, random_state=42)

>>> model = xgp.XGPRegressor(
...    flavor='boosting',
...    loss_metric='mse',
...    funcs='add,sub,mul,div',
...    n_individuals=50,
...    n_generations=20,
...    parsimony_coefficient=0.01,
...    n_rounds=8,
...    random_state=42,
... )

>>> model = model.fit(X_train, y_train, eval_set=(X_test, y_test), verbose=True)

>>> metrics.mean_squared_error(y_train, model.predict(X_train))  # doctest: +ELLIPSIS
17.794685...

>>> metrics.mean_squared_error(y_test, model.predict(X_test))  # doctest: +ELLIPSIS
17.337693...

This will also produce the following output in the shell:

00:00:00 -- train mse: 42.06567 -- val mse: 33.80606 -- round 1
00:00:00 -- train mse: 24.20662 -- val mse: 22.73832 -- round 2
00:00:00 -- train mse: 22.06328 -- val mse: 18.90887 -- round 3
00:00:00 -- train mse: 20.25549 -- val mse: 18.45531 -- round 4
00:00:00 -- train mse: 18.86693 -- val mse: 18.22908 -- round 5
00:00:00 -- train mse: 17.79469 -- val mse: 17.33769 -- round 6
00:00:01 -- train mse: 17.62692 -- val mse: 22.67012 -- round 7
00:00:01 -- train mse: 17.24799 -- val mse: 22.77802 -- round 8

Metadata

Release files for xgp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for xgp 0.1.1
File Interpreter ABI Platform Actions
xgp-0.1.1-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details for xgp-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
xgp-0.1.1-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details for xgp-0.1.1-cp35-cp35m-manylinux1_x86_64.whl

Total release size: 3.7 MB

Release files / xgp-0.1.1-cp36-cp36m-manylinux1_x86_64.whl

Download URL xgp-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
Size 1.8 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
8d268ddcda6b77a8157b1984e9655524c86c1829b08acfae758662fd6f569514
BLAKE2b-256 checksum
How to use checksums
3d043f25d693d653cb87975f5f2ec91e1eb60d32ce3b146d21959bddb0c0318a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.6

Release files / xgp-0.1.1-cp35-cp35m-manylinux1_x86_64.whl

Download URL xgp-0.1.1-cp35-cp35m-manylinux1_x86_64.whl
Size 1.8 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
cd3aeae619df0fcfd129cade8c8a1dd98c7c9c192c3c9328ea687bd584dd8a44
BLAKE2b-256 checksum
How to use checksums
03a2667f78cdf4780407170e4719d86fc48bbc3f58c3f189e670ca0ad650db58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.6

Security for xgp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page