Skip to main content

Interpretability and Diagnostics Tools for Gaussian Processes

Project description

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

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

gpclarity-0.1.3.tar.gz (53.5 kB view details)

Uploaded Source

Built Distribution

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

gpclarity-0.1.3-py3-none-any.whl (40.3 kB view details)

Uploaded Python 3

File details

Details for the file gpclarity-0.1.3.tar.gz.

File metadata

  • Download URL: gpclarity-0.1.3.tar.gz
  • Upload date:
  • Size: 53.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for gpclarity-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d6775e84a641a0160ca0f1c26f6c266452a804cd76d51ecf9714ace7878c5762
MD5 69f0467228bc5aa91e5ea5b6d91c6d41
BLAKE2b-256 556d26fda529ca026706131b05e168d701dbd50d9005f9367500517794b88412

See more details on using hashes here.

File details

Details for the file gpclarity-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: gpclarity-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 40.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for gpclarity-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 36283fb1b625a34c5b59b5ae953d0df0011487036e022ceb031d6275eeebffbb
MD5 996cba20b4579d637887149d4b9830c8
BLAKE2b-256 2fafcf29add5d1043fbb7e567c3429ec1db463388200ace87e2f41fedf8b3248

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