{"id":26891990,"url":"https://github.com/dnv-opensource/gp-diagnostics","last_synced_at":"2026-02-13T23:32:00.947Z","repository":{"id":282966852,"uuid":"921181521","full_name":"dnv-opensource/gp-diagnostics","owner":"dnv-opensource","description":"Tools for diagnosing Gaussian Process models","archived":false,"fork":false,"pushed_at":"2025-02-11T11:28:21.000Z","size":2560,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-20T06:52:37.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnv-opensource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-23T13:50:44.000Z","updated_at":"2025-02-12T10:02:18.000Z","dependencies_parsed_at":"2025-03-19T10:15:50.215Z","dependency_job_id":null,"html_url":"https://github.com/dnv-opensource/gp-diagnostics","commit_stats":null,"previous_names":["dnv-opensource/gp-diagnostics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dnv-opensource/gp-diagnostics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnv-opensource%2Fgp-diagnostics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnv-opensource%2Fgp-diagnostics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnv-opensource%2Fgp-diagnostics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnv-opensource%2Fgp-diagnostics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnv-opensource","download_url":"https://codeload.github.com/dnv-opensource/gp-diagnostics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnv-opensource%2Fgp-diagnostics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29423534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"ssl_error","status_checked_at":"2026-02-13T22:20:49.838Z","response_time":78,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-31T22:48:48.330Z","updated_at":"2026-02-13T23:32:00.940Z","avatar_url":"https://github.com/dnv-opensource.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gp-diagnostics\n\n**gp-diagnostics** is a Python library for diagnosing Gaussian Process (GP) models. It provides tools for advanced\ncross-validation, residual analysis, and visualization to support the evaluation and interpretation of GP regression\nmodels.\n\n![Example plot](examples/normal_q_q_plot_of_transformed_loo_residuals.png)\n\n---\n\n## Key Features\n\n- **Cross-Validation**  \n  - **Leave-One-Out (LOO)** or **Multifold** CV for GP regressions with optional fixed observational noise.  \n  - Fast computation of CV residuals (including covariance) based on the approach by\n  [Ginsbourger and Schaerer (2021)](https://arxiv.org/abs/2101.03108).  \n  - Cholesky-based implementations with fallback checks for matrix definiteness.\n\n- **GP Evaluation Metrics**  \n  - Functions to compute **log marginal likelihood**, **pseudo-likelihood** (for CV), and **mean squared error**.  \n  - Easy integration with existing GP code to measure model performance and residual normality.\n\n- **Diagnostic Plots**\n  - **Histogram of residuals**, **QQ plots**, **predictions vs. true** values, and more.  \n  - Interactive **Plotly** figures for easy exploration and diagnostics.\n\n---\n\n## Installation\n\n```bash\npip install gp-diagnostics\n```\n\n---\n\n## Usage\n\nSee [examples/example.ipynb](examples/example.ipynb) and [examples/exact_gp_example.ipynb](examples/exact_gp_example.ipynb) for detailed usage examples.\n\n---\n\n## Core Modules\n\n**1. `cv.py`**  \n- `loo()`: Leave-One-Out CV residuals and covariance.  \n- `multifold()`: Multifold CV for grouped data (e.g., multiple time series).  \n- Both handle GP prior covariance plus optional noise variance.\n\n**2. `metrics.py`**  \n- `evaluate_GP()`: Calculates log marginal likelihood, pseudo-likelihood, and MSE.  \n- `log_prob_normal()` and `log_prob_standard_normal()`: Useful log probability helpers.\n\n**3. `plots.py`**  \n- Plotly-based functions to visualize residuals (histogram, QQ), predictive intervals, etc.  \n- `qq_residuals()`, `hist_residuals()`, `pred_vs_error()`, and more for quick diagnostics.\n\n**4. `utils`**  \n- **`checks.py`**: Validations (e.g., numeric array, lower-triangular).  \n- **`linalg.py`**: Cholesky utilities, triangular solves, matrix inversion.  \n- **`stats.py`**: QQ data generation, partitioning data folds, etc.\n\n---\n\n## Contributing\n\nPlease feel free to open [issues](https://github.com/dnv-opensource/gp-diagnostics/issues) or submit pull requests if\nyou have ideas for improvements or bug fixes.  \n\nFor local development (requires [`uv`](https://docs.astral.sh/uv/))\n\n1. Clone this repository.\n2. Install dependencies with `uv sync`\n3. Implement your changes and add tests.\n4. Submit a pull request to `main` when ready.\n\n---\n\n## Testing\n\nAll tests live under the `tests/` directory. To run them:\n\n```bash\n# With pytest:\npytest\n\n# Or with tox (runs multiple Python versions, if available):\ntox\n```\n\n---\n\n## Authors\n\n- Christian Agrell ([christian.agrell@dnv.com](mailto\\:christian.agrell@dnv.com))\n- Magnus Kristiansen ([magnus.kristiansen@dnv.com](mailto\\:magnus.kristiansen@dnv.com))\n\n---\n\n## License\n\n[MIT License](LICENSE)  \n\u0026copy; 2024 [DNV](https://www.dnv.com). See [LICENSE](LICENSE) for details.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnv-opensource%2Fgp-diagnostics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnv-opensource%2Fgp-diagnostics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnv-opensource%2Fgp-diagnostics/lists"}