SplineSmoothingFitter#

class astropy.modeling.spline.SplineSmoothingFitter[source]#

Bases: _SplineFitter

Fit a smoothing spline.

Methods Summary

__call__(model, x, y, **kwargs)

Fit a smoothing spline to data.

Methods Documentation

__call__(model, x, y, **kwargs)[source]#

Fit a smoothing spline to data.

Parameters:
modelSpline1D

The spline model to fit.

xnumpy:array_like

The x data values.

ynumpy:array_like

The y data values.

spython:float, optional

Positive smoothing factor used to choose the number of knots. The parameter can be used to control the tradeoff between closeness and smoothness of fit. Larger s means more smoothing while smaller values of s indicate less smoothing. automatically. A value of 0 results in an interpolating spline. See scipy.interpolate.UnivariateSpline for details.

**kwargspython:dict, optional

Additional keyword arguments:

  • weightsarray-like, optional

    Weights for the data points.

  • bboxarray-like, optional

    The bounding box limits as [xmin, xmax]. Default is [None, None].

Returns:
fitted_modelSpline1D

A copy of the input model with fitted parameters.