RadialBasisFunctionInterpolator

Aliases:

  • petres.interpolators.RBFInterpolator


class petres.interpolators.RadialBasisFunctionInterpolator[source]

Bases: BaseInterpolator

Interpolate scalar values with SciPy radial basis functions.

This interpolator wraps scipy.interpolate.RBFInterpolator and validates input shapes and hyperparameters before fitting.

Parameters:
  • kernel ({'linear', 'thin_plate_spline', 'cubic', 'quintic', 'multiquadric', 'inverse_multiquadric', 'inverse_quadratic', 'gaussian'}, default 'thin_plate_spline') – Radial kernel passed to scipy.interpolate.RBFInterpolator.

  • epsilon (float or None, optional) – Shape parameter for some kernels. Must be > 0 when provided.

  • smoothing (float, default 0.0) – Non-negative smoothing factor. 0.0 yields exact interpolation.

  • neighbors (int or None, optional) – If provided, use only the k nearest samples per query; must be > 0.

  • degree (int or None, optional) – Degree of appended polynomial term. None uses SciPy defaults.

  • dtype (numpy.typing.DTypeLike, default numpy.float64) – Storage dtype for cached arrays and outputs.

Notes

The implementation expects scalar targets with shape (n_samples,).

Initialize interpolation hyperparameters.

Raises:

ValueError – If epsilon is not positive, smoothing is negative, neighbors is non-positive, or degree is negative.

__init__(kernel='thin_plate_spline', epsilon=None, smoothing=0.0, neighbors=None, degree=None, dtype=<class 'numpy.float64'>)[source]

Initialize interpolation hyperparameters.

Raises:

ValueError – If epsilon is not positive, smoothing is negative, neighbors is non-positive, or degree is negative.