gemseo.mlearning.regression.algos.rbf_settings module#

Settings of the RBF network for regression.

class Function(value)[source]#

Bases: StrEnum

The radial basis functions.

CUBIC = 'cubic'#
GAUSSIAN = 'gaussian'#
INVERSE_MULTIQUADRIC = 'inverse_multiquadric'#
LINEAR = 'linear'#
MULTIQUADRIC = 'multiquadric'#
QUINTIC = 'quintic'#
THIN_PLATE = 'thin_plate'#
Settings RBFRegressor_Settings(*, transformer=None, parameters=None, input_names=(), output_names=(), function=Function.MULTIQUADRIC, der_function=None, epsilon=None, smooth=0.0, norm='euclidean')[source]#

Bases: BaseRegressorSettings

The settings of the RBF network for regression.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
Return type:

None

der_function: Annotated[Callable[[NDArrayPydantic], NDArrayPydantic], WithJsonSchema({})] | None = None#

The derivative of the radial basis function.

Only to be provided if function is a callable and if the use of the model with its derivative is required. If None and if function is a callable, an error will be raised. If None and if function is a string, the class will look for its internal implementation and will raise an error if it is missing. The der_function shall take three arguments (input_data, norm_input_data, eps). For an RBF of the form function(\(r\)), der_function(\(x\), \(|x|\), \(\epsilon\)) shall return \(\epsilon^{-1} x/|x| f'(|x|/\epsilon)\).

epsilon: float | None = None#

An adjustable constant for Gaussian or multiquadric functions.

If None, use the average distance between input data.

function: Function | Annotated[Callable[[float, float], float], WithJsonSchema({})] = Function.MULTIQUADRIC#

The radial basis function.

This function takes a radius \(r\) as input, representing a distance between two points. If it is a string, then it must be one of the following:

  • "multiquadric" for \(\sqrt{(r/\epsilon)^2 + 1}\),

  • "inverse" for \(1/\sqrt{(r/\epsilon)^2 + 1}\),

  • "gaussian" for \(\exp(-(r/\epsilon)^2)\),

  • "linear" for \(r\),

  • "cubic" for \(r^3\),

  • "quintic" for \(r^5\),

  • "thin_plate" for \(r^2\log(r)\).

If it is a callable, then it must take the two arguments self and r as inputs, e.g. lambda self, r: sqrt((r/self.epsilon)**2 + 1) for the multiquadric function. The epsilon parameter will be available as self.epsilon. Other keyword arguments passed in will be available as well.

norm: str | Annotated[Callable[[NDArrayPydantic, NDArrayPydantic], float], WithJsonSchema({})] = 'euclidean'#

The distance metric.

Either a distance function name known by SciPy or a function that computes the distance between two points.

smooth: float = 0.0#

The degree of smoothness.

0 involves an interpolation of the learning points.