invert4geom.optimal_spline_damping#
- optimal_spline_damping(coordinates, data, weights=None, **kwargs)[source]#
Find the best damping parameter for a verde.SplineCV() fit. All kwargs are passed to the verde.SplineCV class.
- Parameters:
coordinates (
tuple[Series|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]],Series|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]]) â easting and northing coordinates of the datadata (
Series|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) â data for fitting the spline toweights (
Series|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]] |None) â if not None, then the weights assigned to each data point. Typically, this should be 1 over the data uncertainty squared, by default Nonekwargs (
Any)
- Keyword Arguments:
dampings (float | None) â The positive damping regularization parameter. Controls how much smoothness is imposed on the estimated forces. If None, no regularization is used, by default None
force_coords (bool) â The easting and northing coordinates of the point forces. If None (default), then will be set to the data coordinates.
cv (None | cross-validation generator) â Any scikit-learn cross-validation generator. If not given, will use the default set by
verde.cross_val_score.delayed (bool) â If True, will use
dask.delayed.delayedto dispatch computations and allowdaskto execute the grid search in parallel (see note above).scoring (None | str | Callable) â The scoring function (or name of a function) used for cross-validation. Must be known to scikit-learn. See the description of scoring in
sklearn.model_selection.cross_val_scorefor details. If None, will fall back to theverde.Spline.scoremethod.
- Returns:
the spline which best fits the data
- Return type: