SplineExactKnotsFitter#

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

Bases: _SplineFitter

Fit a spline using least-squares regression.

Methods Summary

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

Fit a spline to data using least-squares with exact knots.

Methods Documentation

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

Fit a spline to data using least-squares with exact knots.

Parameters:
modelSpline1D

The spline model to fit.

xnumpy:array_like

The x data values.

ynumpy:array_like

The y data values.

**kwargspython:dict, optional

Additional keyword arguments:

  • tarray-like, optional

    Interior knots for the spline. If not provided, the model’s existing interior knots (t_interior) are used if available. See scipy.interpolate.LSQUnivariateSpline for details.

  • 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.