mojolearn.RBF#

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

Bases: Kernel

Radial basis function (squared exponential) kernel.

Follows scikit-learn’s RBF: k(x, y) = exp(-0.5 * ||(x - y) / length_scale||^2).

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). Any other length is refused when the model is fitted. 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.

Examples

>>> import mojolearn
>>> kernel = mojolearn.RBF(length_scale=[1.0, 2.0, 0.5])
__init__(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0))[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.