[−][src]Struct friedrich::gaussian_process::GaussianProcessBuilder
Builder to set the parameters of a gaussian process.
This class is meant to be produced by the builder
method of the gaussian process and can be used to select the various parameters of the gaussian process :
// training data let training_inputs = vec![vec![0.8], vec![1.2], vec![3.8], vec![4.2]]; let training_outputs = vec![3.0, 4.0, -2.0, -2.0]; // model parameters let input_dimension = 1; let output_noise = 0.1; let exponential_kernel = Exponential::default(); let linear_prior = LinearPrior::default(input_dimension); // defining and training a model let gp = GaussianProcess::builder(training_inputs, training_outputs).set_noise(output_noise) .set_kernel(exponential_kernel) .fit_kernel() .set_prior(linear_prior) .fit_prior() .train();
Methods
impl<KernelType: Kernel, PriorType: Prior> GaussianProcessBuilder<KernelType, PriorType>
[src]
pub fn new<T: Input>(training_inputs: T, training_outputs: T::InVector) -> Self
[src]
builds a new gaussian process with default parameters
the defaults are :
- constant prior (0 unless fitted)
- a gaussian kernel
- a noise of 1% of the output standard deviation (might be re-fitted in the absence of user provided value)
- does not fit parameters
pub fn set_prior<NewPriorType: Prior>(
self,
prior: NewPriorType
) -> GaussianProcessBuilder<KernelType, NewPriorType>
[src]
self,
prior: NewPriorType
) -> GaussianProcessBuilder<KernelType, NewPriorType>
Sets a new prior. See the documentation on priors for more informations.
pub fn set_noise(self, noise: f64) -> Self
[src]
Sets the noise parameter. It correspond to the standard deviation of the noise in the outputs of the training set.
pub fn set_kernel<NewKernelType: Kernel>(
self,
kernel: NewKernelType
) -> GaussianProcessBuilder<NewKernelType, PriorType>
[src]
self,
kernel: NewKernelType
) -> GaussianProcessBuilder<NewKernelType, PriorType>
Changes the kernel of the gaussian process. See the documentations on Kernels for more informations.
pub fn set_fit_parameters(
self,
max_iter: usize,
convergence_fraction: f64
) -> Self
[src]
self,
max_iter: usize,
convergence_fraction: f64
) -> Self
Modifies the stopping criteria of the gradient descent used to fit the noise and kernel parameters.
The optimizer runs for a maximum of max_iter
iterations and stops prematurely if all gradients are below convergence_fraction
time their associated parameter.
pub fn fit_kernel(self) -> Self
[src]
Asks for the parameters of the kernel to be fitted on the training data.
The fitting will be done when the train
method is called.
pub fn fit_prior(self) -> Self
[src]
Asks for the prior to be fitted on the training data.
The fitting will be done when the train
method is called.
pub fn fit_noise(self) -> Self
[src]
Asks for the noise to be fitted on the training data.
The fitting will be done when the train
method is called.
pub fn train(self) -> GaussianProcess<KernelType, PriorType>
[src]
Trains the gaussian process. Fits the parameters if requested.
Auto Trait Implementations
impl<KernelType, PriorType> Send for GaussianProcessBuilder<KernelType, PriorType> where
KernelType: Send,
PriorType: Send,
KernelType: Send,
PriorType: Send,
impl<KernelType, PriorType> Sync for GaussianProcessBuilder<KernelType, PriorType> where
KernelType: Sync,
PriorType: Sync,
KernelType: Sync,
PriorType: Sync,
impl<KernelType, PriorType> Unpin for GaussianProcessBuilder<KernelType, PriorType> where
KernelType: Unpin,
PriorType: Unpin,
KernelType: Unpin,
PriorType: Unpin,
impl<KernelType, PriorType> UnwindSafe for GaussianProcessBuilder<KernelType, PriorType> where
KernelType: UnwindSafe,
PriorType: UnwindSafe,
KernelType: UnwindSafe,
PriorType: UnwindSafe,
impl<KernelType, PriorType> RefUnwindSafe for GaussianProcessBuilder<KernelType, PriorType> where
KernelType: RefUnwindSafe,
PriorType: RefUnwindSafe,
KernelType: RefUnwindSafe,
PriorType: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,