gaussian_process
Builtin index · Statistics & ML
result = gaussian_process(X, y, [kernel="rbf"], [length_scale=], [sigma_f=1], [noise=1e-8])
Input: X, y, kernel, length_scale, sigma_f, noise · Output: result
What it is
Gaussian-process regression on an N-row, D-column matrix X and a length-N target y. Unlike ols_model/ridge_model it reports how much it does not know at each input, which is the reason to use it: .predict(Xnew, variance=true) returns an (M, 2) matrix, column 0 the posterior mean and column 1 the posterior variance — small near the training rows, rising toward sigma_f^2 far from all of them — while plain .predict(Xnew) returns just the length-M mean vector so a GP still drops into pipeline/score like any other regressor. kernel (string) is "rbf" (default, squared exponential) or "matern32" (once differentiable, better for data that is continuous but not glass-smooth). length_scale (number) defaults to the median pairwise distance in X, which keeps it in the data's own units instead of assuming order-1 inputs; sigma_f (number, default 1) is the prior standard deviation; noise (number, default 1e-8) is the observation-noise/jitter added to the kernel diagonal — raise it for noisy measurements. y is centered on its own mean before fitting and the mean is added back on prediction, so the posterior reverts to the data's level far from it, not to zero. The training covariance is factored once with a Cholesky decomposition, so prediction costs two triangular solves.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = gaussian_process(X, y, [kernel="rbf"], [length_scale=], [sigma_f=1], [noise=1e-8]) | X matrixGaussian-process regression on an N-row, D-column matrix X and a length-N target y.y —y is centered on its own mean before fitting and the mean is added back on prediction, so the posterior reverts to the data's level far from it, not to zero.kernel string, optional (default "rbf")kernel (string) is "rbf" (default, squared exponential) or "matern32" (once differentiable, better for data that is continuous but not glass-smooth).length_scale number, optionallength_scale (number) defaults to the median pairwise distance in X, which keeps it in the data's own units instead of assuming order-1 inputs.sigma_f number, optional (default 1)sigma_f (number, default 1) is the prior standard deviation.noise number, optional (default 1e-8)noise (number, default 1e-8) is the observation-noise/jitter added to the kernel diagonal — raise it for noisy measurements. | l —the Cholesky factornoise matrixthe level actually used, which may have been raised to keep the kernel matrix factorable | Returns a fitted model Record with fields x, y, l (the Cholesky factor), alpha, y_mean, kernel, length_scale, sigma_f, noise (the level actually used, which may have been raised to keep the kernel matrix factorable), log_marginal_likelihood, fitted, fitted_variance and n_features. Added in v0.3.0. |
Examples
No documentation example calls this form yet. The Statistics & ML chapter is where one belongs.