Module rusty_machine::learning::gp [] [src]

Gaussian Processes

Provides implementation of gaussian process regression.

Usage

use rusty_machine::learning::gp;
use rusty_machine::learning::SupModel;
use rusty_machine::linalg::Matrix;
use rusty_machine::linalg::Vector;

let mut gaussp = gp::GaussianProcess::default();
gaussp.noise = 10f64;

let train_data = Matrix::new(10,1,vec![0.,1.,2.,3.,4.,5.,6.,7.,8.,9.]);
let target = Vector::new(vec![0.,1.,2.,3.,4.,4.,3.,2.,1.,0.]);

gaussp.train(&train_data, &target).unwrap();

let test_data = Matrix::new(5,1,vec![2.3,4.4,5.1,6.2,7.1]);

let outputs = gaussp.predict(&test_data).unwrap();

Alternatively one could use gaussp.get_posterior() which would return both the predictive mean and covariance. However, this is likely to change in a future release.

Structs

ConstMean

Constant mean function

GaussianProcess

Gaussian Process struct

Traits

MeanFunc

Trait for GP mean functions.