1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! Gaussian Process Regression Module
//!
//! This module provides a complete implementation of Gaussian Process regression,
//! compatible with scikit-learn's API. It can be used for:
//!
//! - Non-parametric function approximation
//! - Bayesian optimization
//! - Uncertainty quantification
//! - Time series forecasting
//! - Spatial interpolation
//!
//! # Features
//!
//! - Multiple kernel functions (RBF, Matérn, etc.)
//! - Prior mean functions
//! - Prediction with uncertainty estimates
//! - Hyperparameter optimization via marginal likelihood
//! - SciRS2 POLICY compliant (uses scirs2-core abstractions)
//!
//! # Examples
//!
//! ## Basic Usage
//!
//! ```
//! use scirs2_stats::gaussian_process::{GaussianProcessRegressor, SquaredExponential};
//! use scirs2_core::ndarray::{array, Array2};
//!
//! let kernel = SquaredExponential::default();
//! let mut gpr = GaussianProcessRegressor::new(kernel);
//!
//! let x_train = Array2::from_shape_vec((3, 1), vec![0.0, 1.0, 2.0]).expect("Operation failed");
//! let y_train = array![0.0, 1.0, 0.0];
//!
//! gpr.fit(&x_train, &y_train).expect("Operation failed");
//!
//! let x_test = Array2::from_shape_vec((1, 1), vec![1.5]).expect("Operation failed");
//! let predictions = gpr.predict(&x_test).expect("Operation failed");
//! println!("Prediction: {}", predictions[0]);
//! ```
//!
//! ## With Uncertainty
//!
//! ```
//! use scirs2_stats::gaussian_process::{GaussianProcessRegressor, SquaredExponential};
//! use scirs2_core::ndarray::{array, Array2};
//!
//! let kernel = SquaredExponential::default();
//! let mut gpr = GaussianProcessRegressor::new(kernel);
//!
//! let x_train = Array2::from_shape_vec((3, 1), vec![0.0, 1.0, 2.0]).expect("Operation failed");
//! let y_train = array![0.0, 1.0, 0.0];
//!
//! gpr.fit(&x_train, &y_train).expect("Operation failed");
//!
//! let x_test = Array2::from_shape_vec((1, 1), vec![1.5]).expect("Operation failed");
//! let (mean, std) = gpr.predict_with_std(&x_test).expect("Operation failed");
//! println!("Prediction: {} ± {}", mean[0], std[0]);
//! ```
//!
//! ## Custom Kernel
//!
//! ```
//! use scirs2_stats::gaussian_process::{
//! GaussianProcessRegressor, Matern52, SumKernel, WhiteKernel
//! };
//! use scirs2_core::ndarray::{array, Array2};
//!
//! // Matérn kernel + noise
//! let matern = Matern52::new(1.0, 1.0);
//! let noise = WhiteKernel::new(0.1);
//! let kernel = SumKernel::new(matern, noise);
//!
//! let mut gpr = GaussianProcessRegressor::new(kernel);
//!
//! let x_train = Array2::from_shape_vec((2, 1), vec![0.0, 1.0]).expect("Operation failed");
//! let y_train = array![0.0, 1.0];
//!
//! gpr.fit(&x_train, &y_train).expect("Operation failed");
//! ```
// Re-export main types
pub use GaussianProcess;
pub use ;
pub use ;
pub use ;