Skip to content

Commit

Permalink
[krige] add exact_values support
Browse files Browse the repository at this point in the history
  • Loading branch information
basaks committed Nov 7, 2023
1 parent 85efb68 commit ae3b531
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 8 additions & 9 deletions configs/kriging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,15 @@ learning:
arguments:
method: ordinary # ordinary or universal
variogram_model: spherical # linear, power, gaussian, spherical, exponential
variogram_parameters: [0, 1, 0.1] # [sill, range, nugget] for gaussian, spherical, exponential
variogram_parameters: [0.0, 1, 0.1] # [sill, range, nugget] for gaussian, spherical, exponential
verbose: False


optimisation:
algorithm: krige
hyperparameters:
method: [ordinary, universal]
variogram_model: [linear, power, gaussian, spherical, exponential]
optimisation_output: optimisation.csv
exact_values: False
# optimisation:
# algorithm: krige
# hyperparameters:
# method: [ordinary, universal]
# variogram_model: [linear, power, gaussian, spherical, exponential]
# optimisation_output: optimisation.csv

# outbands: number of output bands desired.
# Bands (1:5): ['Prediction', 'Variance', 'Lower quantile',
Expand Down
3 changes: 3 additions & 0 deletions uncoverml/krige.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def __init__(self,
nlags=6,
weight=False,
n_closest_points=10,
exact_values=False,
verbose=False
):
if method not in krige_methods.keys():
Expand All @@ -110,6 +111,7 @@ def __init__(self,
self.n_closest_points = n_closest_points
self.model = None # not trained
self.method = method
self.exact_values = exact_values

def fit(self, x, y, *args, **kwargs):
"""
Expand All @@ -132,6 +134,7 @@ def fit(self, x, y, *args, **kwargs):
verbose=self.verbose,
nlags=self.nlags,
weight=self.weight,
exact_values=self.exact_values,
)

def predict(self, x, *args, **kwargs):
Expand Down

0 comments on commit ae3b531

Please sign in to comment.