ConstantMean<T>

Models & Types · AiDotNet.GaussianProcesses

Implements a constant mean function.

Implements: IMeanFunction<T>

For Beginners

The constant mean function returns the same value for all inputs.

m(x) = c

Why use constant mean?

  • When your data has a known average value
  • When you expect predictions far from training data to revert to this constant
  • As a simple baseline trend

The constant can be:

  • Set manually based on domain knowledge
  • Learned during hyperparameter optimization
  • Set to the empirical mean of your training targets

Example: If predicting house prices in thousands, you might set c = 300 to represent your prior belief that houses cost around $300k on average.

Constructors

Constructor Summary
ConstantMean(T constant) Initializes a constant mean with a double value.
ConstantMean(double constant) Initializes a constant mean with a double value.

Properties

Property Summary
T Constant { get; } Gets the constant value.

Methods

Method Summary
T Evaluate(Vector<T> x) Returns a vector of the constant for all input points.
Vector<T> Evaluate(Matrix<T> X) Returns a vector of the constant for all input points.