Registry / ai-ml / gpy
library1.13.2pypypiunverified

GPy is a Gaussian process (GP) framework written in Python, designed for flexible and robust GP modeling. It provides a comprehensive suite of tools for defining, manipulating, and optimizing Gaussian process models, including various kernels, likelihoods, and inference methods. The current version is 1.13.2, with releases occurring periodically, often tied to maintenance or feature additions rather than a strict schedule.

pip install gpy
INSTALL
IMPORT
SIG · GPY
G
gpy
ai-mlpythonv1.13.2
Install
9.1s avg
Import
Disk
260MB
Pass rate
7/ 10
Env Coverage7 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.13.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 8.85s
py 3.11
✓ —
✓ 8.4s
py 3.12
✕ build_error
✓ 8.5s
py 3.13
✕ build_error
✕ build_error
py 3.9
✓ —
✓ 10.6s
260MB installed
● package 260MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GPy
import GPy
GPRegression
import GPy; model = GPy.models.GPRegression(...)
from GPy import GPRegression
GPRegression is located within the GPy.models submodule, not directly in the top-level GPy package.
RBF
import GPy; kernel = GPy.kern.RBF(...)
from GPy import RBF
Kernels like RBF are found in the GPy.kern submodule.

This quickstart demonstrates how to create a simple Gaussian Process regression model, define a kernel, fit it to some synthetic data, and optimize its hyperparameters using GPy. The example also shows how to print the optimized model parameters.

import GPy import numpy as np # 1. Generate some synthetic data X = np.random.uniform(-3., 3., (20, 1)) Y = np.sin(X) + np.random.randn(20, 1) * 0.05 # 2. Define a kernel (e.g., Radial Basis Function) kernel = GPy.kern.RBF(input_dim=1, variance=1., lengthscale=1.) # 3. Create a GP regression model m = GPy.models.GPRegression(X, Y, kernel) # 4. Optimize the model's hyperparameters m.optimize(messages=True, max_iters=100) # Print optimized parameters print(m) # To plot (requires matplotlib): # import matplotlib.pyplot as plt # m.plot() # plt.show()
Debug
Known issues
breakingGPy no longer supports Python 2.x. It explicitly requires Python 3.9 or newer.
fix
Ensure your environment uses Python 3.9 or a more recent version.
affects: <=1.9.9 (Python 2.x support), >=1.10.0 (Python 3 only)
gotchaOptimization (`m.optimize()`) does not guarantee finding the global optimum for complex models and datasets, and can get stuck in local minima or fail to converge.
fix
Consider using `m.optimize_restarts(num_restarts=N)` with a sufficient number of restarts, trying different initial parameter values, or increasing `max_iters`. Inspect the objective function carefully.
affects: All versions
gotchaGPy's plotting capabilities rely on `matplotlib`. Issues may arise if `matplotlib` is not installed, or if there are backend conflicts in non-interactive environments.
fix
Install `matplotlib` (`pip install matplotlib`). For non-interactive environments, explicitly set a non-interactive backend for `matplotlib` (e.g., `matplotlib.use('Agg')`) before importing `matplotlib.pyplot`.
affects: All versions
gotchaGPy's dependency on `numpy` and `scipy` means that version mismatches can sometimes lead to unexpected errors or deprecation warnings, especially with very new `numpy`/`scipy` releases and older GPy versions.
fix
Keep GPy updated to the latest stable version. If encountering issues, try aligning `numpy` and `scipy` versions with those GPy was tested against (check GPy's `setup.py` or documentation).
affects: All versions, particularly older GPy with newer numpy/scipy
Upgrade
Version history
1.13.2latest on PyPI · released Jul 23, 2024
Audit
Dependencies
numpyrequiredCore numerical operations and array handling.
scipyrequiredScientific computing routines, including optimization and special functions.
matplotliboptionalRequired for built-in plotting functionalities.
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
gpy — pip install gpy · libregistry