Skip to main content

Classes for Gaussian Process Regression fitting of ND data with errorbars

Project description

mkgp

These classes and routines were developed by Aaron Ho, and this project repository was started in 2017. The underlying mathematics was founded on the book, “Gaussian Process for Machine Learning”, C.E. Rasmussen, C.K.I. Williams (2006).

When using this package in any research work, please cite: A. Ho et al 2019 Nucl. Fusion 59 056007, DOI: 10.1088/1741-4326/ab065a

Note that the package has been renamed from GPR1D -> mkgp in v3.0.0.

Installing the mkgp program

Installation is mandatory for this package!

For first time users, it is strongly recommended to use the GUI developed for this Python package. To obtain the Python package dependencies needed to use this capability, install this package by using the following on the command line:

pip install [--user] mkgp[gui]

Use the --user flag if you do not have root access on the system that you are working on. If you have already cloned the repository, enter the top level of the repository directory and use the following instead:

pip install [--user] -e .[gui]

Removal of the [gui] portion will no longer check for the pyqt5 and matplotlib packages needed for this functionality. However, these packages are not crucial for the base classes and algorithms.

To test the installation, execute the command line script:

mkgp_1d_demo

This demonstration benefits from having matplotlib installed, but is not required.

Documentation

Documentation of the equations used in the algorithm, along with the available kernels and optimizers, can be found in docs/. Documentation of the mkgp module can be found on GitLab pages

Using the gpr1d program

For those who wish to include the functionality of this package into their own Python scripts, a sample script is provided in src/mkgp/scripts/demo.py. The basic syntax used to create kernels, select optimizers, and perform the GP regression fits are outlined there.

For any questions or to report bugs, please do so through the proper channels in the GitLab repository.

Important note for users!

The following runtime warnings are common within this routine:

RuntimeWarning: overflow encountered in double_scalars
RuntimeWarning: invalid value encountered in true_divide
RuntimeWarning: invalid value encountered in sqrt

They are filtered out by default but may reappear if verbosity settings are modified. They normally occur when using the kernel restarts option (as in the demo) and do not necessarily mean that the final returned fit is poor.

Plotting the returned fit and errors is the recommended way to check its quality. The log-marginal-likelihood metric can also be used, but is only valuable when comparing different fits of the same data, i.e. its absolute value is meaningless.

From v1.1.1, the adjusted R2 and pseudo R2 metrics are now available. The adjusted R2 metric provides a measure of how close the fit is to the input data points. The pseudo R2 provides a measure of this closeness accounting for the input data uncertainties.

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

mkgp-3.1.1.tar.gz (806.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkgp-3.1.1-py3-none-any.whl (69.3 kB view details)

Uploaded Python 3

File details

Details for the file mkgp-3.1.1.tar.gz.

File metadata

  • Download URL: mkgp-3.1.1.tar.gz
  • Upload date:
  • Size: 806.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mkgp-3.1.1.tar.gz
Algorithm Hash digest
SHA256 6462617374418c5b96b291033f280faf6366b11dec96a8bdc8c189ded91aa138
MD5 b73d9c8a0d4c12b5f24170e428eb1369
BLAKE2b-256 823671138404bd036530d15592f806648d82152e382034086b1e4e91b168d4c0

See more details on using hashes here.

File details

Details for the file mkgp-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: mkgp-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 69.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mkgp-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4e60f611011ac409e03fb5d9894970c8dd436ebbe66ad9fe898ed8990d45b0b
MD5 afd35e6e166b5c9326b83459d0667cf7
BLAKE2b-256 04646d7ce83541a6791dc6b8e6887b32423c4ba3ac487114c5ef16a637ed4a17

See more details on using hashes here.

Supported by

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