cosapp.utils.surrogate_models.nn_interpolators.weighted_interpolator

Define the WeightedInterpolator class.

Classes

WeightedInterpolator(training_points, ...[, ...])

Weighted Neighbor Interpolation.

class cosapp.utils.surrogate_models.nn_interpolators.weighted_interpolator.WeightedInterpolator(training_points, training_values, num_leaves=2)[source]

Bases: NNBase

Weighted Neighbor Interpolation.

gradient(prediction_points, num_neighbors=5, dist_eff=0)[source]

Find the gradient at each location of a set of supplied predicted points.

Parameters:
  • prediction_points (ndarray) – Points at which interpolation is done.

  • num_neighbors (int) – Number of neighbors to use.

  • dist_eff (float) – Exponent used for the distance weighting. Using dist_eff=0 will default to self._indep_dims + 1.

Returns:

Gradient values at the prediction points.

Return type:

ndarray