GaussianProcessBuilder

GaussianProcessBuilder

Builder to set the parameters of a Gaussian process (builder.rs).

Chainable setters culminating in train(). Produced by GaussianProcess.builder(inputs, outputs).

Defaults (builder.rs:66):

  • constant prior (0 unless fitted)
  • a Gaussian kernel
  • noise = 10% of the output standard deviation
  • does not fit any parameters
  • fit runs for ≤ 100 iterations / 1 hour unless all gradients are below 5%.

Setters mutate and return this (Rust returns a new typed builder; for JS we keep a single mutable builder — behaviour is identical for the fluent API).

Constructor

new GaussianProcessBuilder(trainingInputs, trainingOutputs)

Source:
Parameters:
Name Type Description
trainingInputs Array.<number> | Array.<Array.<number>>
trainingOutputs number | Array.<number>

Classes

GaussianProcessBuilder

Members

choleskyEpsilon :number|null

Source:
Type:
  • number | null

convergenceFraction :number

Source:
Type:
  • number

kernel :object

Source:
Type:
  • object

maxIter :number

Source:
Type:
  • number

maxTime :number

Description:
  • max fitting time in milliseconds

Source:

max fitting time in milliseconds

Type:
  • number

noise :number

Source:
Type:
  • number

prior :object

Source:
Type:
  • object

shouldFitKernel :boolean

Source:
Type:
  • boolean

shouldFitPrior :boolean

Source:
Type:
  • boolean

trainingInputs :Array.<Array.<number>>

Source:
Type:
  • Array.<Array.<number>>

trainingOutputs :Array.<number>

Source:
Type:
  • Array.<number>

Methods

fitKernel() → {this}

Description:
  • Asks for the kernel parameters to be fitted on the training data (applied when train() is called).

Source:
Returns:
Type
this

fitPrior() → {this}

Description:
  • Asks for the prior to be fitted on the training data (applied when train() is called).

Source:
Returns:
Type
this

setCholeskyEpsilon(choleskyEpsilon) → {this}

Description:
  • Sets the Cholesky epsilon. When a strictly positive value is given, the Cholesky decomposition is guaranteed to succeed (the value is used in place of a non-positive diagonal pivot). null ignores it.

Source:
Parameters:
Name Type Description
choleskyEpsilon number | null
Returns:
Type
this

setFitParameters(maxIter, convergenceFraction) → {this}

Description:
  • Modifies the stopping criteria of the gradient descent used to fit the noise and kernel parameters.

Source:
Parameters:
Name Type Description
maxIter number
convergenceFraction number
Returns:
Type
this

setKernel(kernel) → {this}

Description:
  • Changes the kernel of the Gaussian process.

Source:
Parameters:
Name Type Description
kernel object
Returns:
Type
this

setNoise(noise) → {this}

Description:
  • Sets the noise parameter (standard deviation of the output noise).

Source:
Parameters:
Name Type Description
noise number

(≥ 0)

Returns:
Type
this

setPrior(prior) → {this}

Description:
  • Sets a new prior.

Source:
Parameters:
Name Type Description
prior object
Returns:
Type
this

train() → {GaussianProcess}

Description:
  • Trains the Gaussian process, fitting the parameters if requested (builder.rs:189).

    Steps:

    1. if shouldFitKernelkernel.heuristicFit(inputs, outputs) using the RAW outputs (the builder has not subtracted the prior yet).
    2. construct the GaussianProcess.
    3. gp.fit_parameters(shouldFitPrior, shouldFitKernel, …).
Source:
Returns:
Type
GaussianProcess