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.0.2.tar.gz (53.0 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.0.2-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gpclarity-0.0.2.tar.gz
Algorithm Hash digest
SHA256 30bd454ffbbeb4f88957b66b10cfe19335715cb25d9e46476bf14660b653a7c0
MD5 ea6a847e9fa97ead0355f5c9d8de294f
BLAKE2b-256 7850647879fd50c7e72addb8ea4524a0634861a1add3f657af5701ddc8db0a9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gpclarity-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 40.8 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.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 830ea7f93988827d67eef6f71b242e4b33cd7c4b8b8bbcf315a5a3c3c50a8511
MD5 780f0951c769f197d9b69f12d4a55106
BLAKE2b-256 78f764fb5c3754a939332933cf7eaa3d735fe09d3bc98c8e40f97b8cfcbfc2fc

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