mojolearn.Matern#
- class mojolearn.Matern(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), nu=1.5)[source]#
Bases:
KernelMatern kernel with
nuin {0.5, 1.5, 2.5}.Follows scikit-learn’s
Matern, with the same argument order. Only the three closed forms are supported:nu=0.5(absolute exponential),1.5(once differentiable) and2.5(twice differentiable). Any othernu, includinginf, is refused with an error when the model is fitted; useRBFfor thenu=inflimit.- Parameters:
length_scale (float or sequence of float, default 1.0) – A scalar gives an isotropic kernel; a sequence of
n_featuresvalues gives one length scale per feature (anisotropic). Values must be positive and finite; they are checked at fit time.length_scale_bounds (pair of float, sequence of pairs, or “fixed”, default (1e-5, 1e5)) – Bounds for the optimizer: one pair for every length scale, one pair per length scale, or
"fixed". Both bounds must be finite and positive withlow <= high; otherwiseValueErroris raised.nu (float, default 1.5) – Smoothness: 0.5, 1.5 or 2.5.
Examples
>>> import mojolearn >>> kernel = mojolearn.Matern(length_scale=1.0, nu=2.5)
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.