invert4geom.eq_sources_score#
- eq_sources_score(coordinates, data, delayed=False, weights=None, **kwargs)[source]#
Calculate the cross-validation score for fitting gravity data to equivalent sources. Uses Verdeβs cross_val_score function to calculate the score. All kwargs are passed to the harmonica.EquivalentSources class.
- Parameters:
coordinates (
tuple[ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]],ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]],ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]]) β tuple of easting, northing, and upward coordinates of the gravity datadata (
Series|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) β the gravity datadelayed (
bool) β compute the scores in parallel if True, by default Falseweights (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]] |None) β optional weight values for each gravity data point, by default Nonekwargs (
Any)
- Keyword Arguments:
damping (float | None) β The positive damping regularization parameter. Controls how much smoothness is imposed on the estimated coefficients. If None, no regularization is used.
points (list[numpy.ndarray] | None) β List containing the coordinates of the equivalent point sources. Coordinates are assumed to be in the following order: (
easting,northing,upward). If None, will place one point source below each observation point at a fixed relative depth below the observation point. Defaults to None.depth (float | str) β Parameter used to control the depth at which the point sources will be located. If a value is provided, each source is located beneath each data point (or block-averaged location) at a depth equal to its elevation minus the
depthvalue. If set to"default", the depth of the sources will be estimated as 4.5 times the mean distance between first neighboring sources. This parameter is ignored if points is specified. Defaults to"default".block_size (float | tuple[float, float] | None) β Size of the blocks used on block-averaged equivalent sources. If a single value is passed, the blocks will have a square shape. Alternatively, the dimensions of the blocks in the South-North and West-East directions can be specified by passing a tuple. If None, no block-averaging is applied. This parameter is ignored if points are specified. Default to None.
parallel (bool) β If True any predictions and Jacobian building is carried out in parallel through Numbaβs
jit.prange, reducing the computation time. If False, these tasks will be run on a single CPU. Default to True.dtype (str) β The desired data-type for the predictions and the Jacobian matrix. Default to
"float64".
- Returns:
a float of the score, the higher the value to better the fit.
- Return type: