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.2.tar.gz (51.6 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.2-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gpclarity-0.1.2.tar.gz
  • Upload date:
  • Size: 51.6 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.2.tar.gz
Algorithm Hash digest
SHA256 c938b6dc5364640d25646419e57d35854a16029e381e651797ede7bdf0cdafd8
MD5 ee98615aece55af76ab961221e08e914
BLAKE2b-256 5cac90cda5e8e5ac725cf119214cb6a5aac15a39ad0aff1da9d885e7593cd8a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gpclarity-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 38.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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ed924359f698a5ea3bf4815ddc43c61a941d4d6e5b4dcbec55f588b4f80c412
MD5 64ff47c28a278ff2401894f081668c02
BLAKE2b-256 958a5abb9d1c691fc46137abd651dfd9b7c8f59bd5586d1b6061c3a7b5f95896

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