mojolearn.Matern#

class mojolearn.Matern(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), nu=1.5)[source]#

Bases: Kernel

Matern kernel with nu in {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) and 2.5 (twice differentiable). Any other nu, including inf, is refused with an error when the model is fitted; use RBF for the nu=inf limit.

Parameters:
  • length_scale (float or sequence of float, default 1.0) – A scalar gives an isotropic kernel; a sequence of n_features values 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 with low <= high; otherwise ValueError is 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)
__init__(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), nu=1.5)[source]#

Attributes

bounds

Natural log of each free hyperparameter's (low, high) bounds, as a list of [low, high] pairs.

n_dims

Number of free hyperparameters (the length of theta).

theta

Natural log of the free hyperparameters, as a list of floats.