Skip to main content

GPClarity: Gaussian Process Interpretability Toolkit

Python Version License Build Status

GPClarity is a production-ready library that transforms black-box Gaussian Process models into interpretable, debuggable, and trustworthy tools. Built on GPy and emukit, it provides human-readable insights into kernel behavior, uncertainty patterns, and model complexity.


🎯 Features

  • 🔍 Kernel Interpretation: Translate raw kernel math into human meaning
  • 📊 Uncertainty Profiling: Visualize and diagnose uncertainty behavior
  • 📈 Hyperparameter Tracking: Monitor optimization dynamics in real-time
  • 🧮 Complexity Quantification: Measure and prevent overfitting
  • 🎯 Data Influence Analysis: Identify impactful training points
  • 🔗 Emukit Integration: Seamless Bayesian optimization support

🚀 Quick Start

import gpclarity
import GPy
import numpy as np

# Train a Gaussian Process
X = np.linspace(0, 10, 50).reshape(-1, 1)
y = np.sin(X).flatten() + 0.1 * np.random.randn(50)

kernel = GPy.kern.RBF(1) + GPy.kern.White(1)
model = GPy.models.GPRegression(X, y[:, None], kernel)
model.optimize()

summary = gpclarity.summarize_kernel(model)

profiler = gpclarity.UncertaintyProfiler(model)
X_test = np.linspace(-2, 12, 200).reshape(-1, 1)
profiler.plot(X_test, X_train=X, y_train=y)

tracker = gpclarity.HyperparameterTracker(model)
history = tracker.wrapped_optimize(max_iters=50)
tracker.plot_evolution()

complexity = gpclarity.compute_complexity_score(model, X)
print(f"Complexity: {complexity['score']:.2f} - {complexity['interpretation']}")

📦 Installation

Stable Release

pip install gpclarity

Development Version

git clone https://github.com/AngadKumar16/gpclarity.git
cd gpclarity
pip install -e ".[dev]"

Conda (coming soon)

conda install -c conda-forge gpclarity

🏗️ Architecture

gpclarity/
├── kernel_summary
├── uncertainty_analysis
├── hyperparam_tracker
├── model_complexity
├── data_influence
└── utils

🔬 Advanced Usage

Emukit Integration

from gpclarity import ClarityBayesianOptimizationLoop

loop = ClarityBayesianOptimizationLoop(model, space)
loop.run_loop(user_function, stopping_condition)
loop.plot_diagnostics()

Batch Processing

models = [model1, model2, model3]
reports = [gpclarity.summarize_kernel(m, verbose=False) for m in models]

📊 Example Outputs

Kernel Summary

🔍 KERNEL SUMMARY
Structure: ['RBF', 'White']
Components: 2

📦 RBF (lengthscale)
  └─ lengthscale: 1.23
  💡 Moderate flexibility

📦 White (variance)
  └─ variance: 0.01
  💡 Low observation noise

Complexity Report

{
  "score": 2.34,
  "interpretation": "Moderate complexity (well-balanced)",
  "components": {
    "n_kernel_parts": 2,
    "roughness_score": 0.81,
    "noise_ratio": 4.5
  }
}

🎓 Citation

@software{gpclarity2026,
  title={gpclarity: Gaussian Process Interpretability Toolkit},
  author={Angad Kumar},
  year={2026},
  url={https://github.com/AngadKumar16/gpclarity},
  version={0.1.0}
}

📝 License

GPClarity is licensed under the MIT License. See LICENSE for details.

🤝 Contributing

Contributions are welcome!

  • Report bugs or request features via GitHub Issues
  • Submit pull requests for fixes or enhancements
  • Make sure to follow the code style and write tests for new features

Author: Angad Kumar (GitHub, Email)

🛣️ Roadmap

  • Conda package support
  • More visualization tools for kernel decomposition
  • Automated tutorials / example notebooks
  • More features overall

Metadata

Release files for gpclarity 0.1.3

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

Source distribution (sdist)

Source distribution for gpclarity 0.1.3
File Size Uploaded Provenance Actions
gpclarity-0.1.3.tar.gz 53.5 kB Without provenance Details for gpclarity-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpclarity 0.1.3
File Interpreter ABI Platform Actions
gpclarity-0.1.3-py3-none-any.whl Python 3 none any Details for gpclarity-0.1.3-py3-none-any.whl

Total release size: 93.8 kB

Release files / gpclarity-0.1.3.tar.gz

Download URL gpclarity-0.1.3.tar.gz
Size 53.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d6775e84a641a0160ca0f1c26f6c266452a804cd76d51ecf9714ace7878c5762
BLAKE2b-256 checksum
How to use checksums
556d26fda529ca026706131b05e168d701dbd50d9005f9367500517794b88412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / gpclarity-0.1.3-py3-none-any.whl

Download URL gpclarity-0.1.3-py3-none-any.whl
Size 40.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36283fb1b625a34c5b59b5ae953d0df0011487036e022ceb031d6275eeebffbb
BLAKE2b-256 checksum
How to use checksums
2fafcf29add5d1043fbb7e567c3429ec1db463388200ace87e2f41fedf8b3248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for gpclarity 0.1.3

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