mojolearn.ConstantKernel#
- class mojolearn.ConstantKernel(constant_value=1.0, constant_value_bounds=(1e-05, 100000.0))[source]#
Bases:
KernelConstant kernel:
k(x, y) = constant_valuefor every pair of points.Follows scikit-learn’s
ConstantKernel. Multiply it with another kernel to scale that kernel’s magnitude.- Parameters:
constant_value (float, default 1.0) – The constant.
constant_value_bounds (pair of float or “fixed”, default (1e-5, 1e5)) – Bounds for the optimizer, or
"fixed"to keep the value fixed. Both bounds must be finite and positive withlow <= high; otherwiseValueErroris raised.
Examples
>>> import mojolearn >>> kernel = mojolearn.ConstantKernel(2.0) * mojolearn.RBF(1.0)
Attributes
boundsNatural log of each free hyperparameter's
(low, high)bounds, as a list of[low, high]pairs.n_dimsNumber of free hyperparameters (the length of
theta).thetaNatural log of the free hyperparameters, as a list of floats.