invert4geom.DatasetAccessorInvert4Geom.regional_constraints_cv

invert4geom.DatasetAccessorInvert4Geom.regional_constraints_cv#

DatasetAccessorInvert4Geom.regional_constraints_cv(constraints_df, split_kwargs=None, regional_shift=0, mask_column=None, reverse_regional_residual=False, **kwargs)[source]#

This is a convenience function to wrap optimize_regional_constraint_point_minimization. It takes a full constraints dataframe and dictionary split_kwargs, to split the constraints into testing and training sets (with K-folds), uses these folds in a K-Folds hyperparameter optimization to find the set of parameter values (tension factor, spline damping, or equivalent source depth and damping) which estimates the best regional field. It then uses the optimal parameter values and all of the constraint points to re-calculate the best regional field. All kwargs are passed to the function optimize_regional_constraint_point_minimization.

Parameters:
  • constraints_df (DataFrame) – dataframe of constraints with columns easting, northing (or longitude, latitude), and upward.

  • split_kwargs (dict[str, Any] | None) – kwargs to be passed to split_test_train, by default None

  • regional_shift (float) – shift to add to the regional field, by default 0

  • mask_column (str | None) – Name of optional dataset variable with values to multiply the calculated residual gravity field by, should have values of 1 or 0, by default None.

  • reverse_regional_residual (bool) – if True, reverse the regional and residual fields after calculation, by default False

  • **kwargs (Any) – kwargs to be passed to optimize_regional_constraint_point_minimization

Return type:

None