invert4geom.optimal_spline_damping

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:
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.delayed to dispatch computations and allow dask to 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_score for details. If None, will fall back to the verde.Spline.score method.

Returns:

the spline which best fits the data

Return type:

Spline