hydrobox.geostat.gridsearch¶
- hydrobox.geostat.gridsearch(param_grid, variogram=None, coordinates=None, values=None, score='rmse', cross_validate=True, n_jobs=- 1, return_type='object', **kwargs)¶
Automated GridSerarch for best variogram parameters. Uses
GridSearchCV
to find the best parameter set.- Parameters
param_grid (dict) – List of parameters that should be used to form the grid. Each key has to be a valid argument to
Variogram
along with a list of valid options to try.variogram (skgstat.Variogram) – Variogram instance that should be used to find more suitable parameters. If given, coordinates, values and kwargs will be ignored
coordinates (numpy.ndarray) – Array of coordinates. Mandatory if variogram is None.
values (numpy.ndarray) – Array of values. Mandatory if variogram is None.
score (str) – Score to find the best parameter set. Has to be one of [‘rmse’, ‘mse’, ‘mae’]
cross_validate (bool) –
If True (default) the score will be applied to a leave-one-out cross-validation of a Kriging using the current Variogram. If False, the model fit to the experimental variogra, will be scored. .. note:
Needs at least `scikit-gstat>=0.5.4`.
n_jobs (int) – Will be passed down to
GridSearchCV
return_type (str) – Either ‘object’, to return the GridSerachCV object or ‘best_param’ to return a dictionary of the best params.
- Return type
- Returns
gridSearch (sklearn.model_selection.GridSearchCV) – if return type is ‘object’
best_params (dict) – if return type is ‘best_param’
- Raises
AttributeError : – if neither a
Variogram
or both coordinates and values are given
See also
skgstat.interface.VariogramEstimator
,sklearn.model_selection.GridSearchCV