Mean functions

Mean functions are subtracted from y before fitting and added back at predict time. Defaults to ZeroMean.

class lightgp.Mean

Abstract base for mean functions.

name() str
num_params() int
class lightgp.ZeroMean

Returns the zero vector. Has no parameters. The default.

class lightgp.ConstantMean(c: float = 0.0)

\(m(x) = c\). One scalar parameter.

# Useful when targets have a known nonzero offset.
model = gp.GPExact(gp.RBF(), mean=gp.ConstantMean())
class lightgp.LinearMean(input_dim: int)

\(m(x) = w^\top x + b\). input_dim + 1 parameters.

# Useful for data with a linear trend (e.g. Mauna Loa CO2).
model = gp.GPExact(gp.RBF(), mean=gp.LinearMean(input_dim=1))