cosapp.utils.surrogate_models.nearest_neighbor¶
Surrogate model based on the N-Dimensional Interpolation library by Stephen Marone.
https://github.com/SMarone/NDInterp
Classes
|
Surrogate model that approximates values using a linear interpolator. |
|
Surrogate model that approximates values using a nearest neighbor approximation. |
|
Surrogate model that approximates values using a RBF interpolator. |
|
Surrogate model that approximates values using a weighted interpolator. |
- class cosapp.utils.surrogate_models.nearest_neighbor.LinearNearestNeighbor(**options)[source]¶
Bases:
NearestNeighborSurrogate model that approximates values using a linear interpolator.
- interpolant¶
Interpolator object
- Type:
object
- options¶
Input keyword arguments for the interpolator.
- Type:
dict
- class cosapp.utils.surrogate_models.nearest_neighbor.NearestNeighbor(interpolant_type='rbf', **options)[source]¶
Bases:
SurrogateModelSurrogate model that approximates values using a nearest neighbor approximation.
- interpolant¶
Interpolator object
- Type:
object
- options¶
Input keyword arguments for the interpolator.
- Type:
dict
- static interpolators() Dict[str, Type[SurrogateModel]][source]¶
- linearize(x, **kwargs)[source]¶
Calculate the jacobian of the interpolant at the requested point.
- Parameters:
x (array-like) – Point at which the surrogate Jacobian is evaluated.
**kwargs (dict) – Additional keyword arguments passed to the interpolant.
- Returns:
Jacobian of surrogate output wrt inputs.
- Return type:
ndarray
- predict(x, **kwargs)[source]¶
Calculate a predicted value of the response based on the current trained model.
- Parameters:
x (array-like) – Point(s) at which the surrogate is evaluated.
**kwargs (dict) – Additional keyword arguments passed to the interpolant.
- Returns:
Predicted value.
- Return type:
float
- class cosapp.utils.surrogate_models.nearest_neighbor.RBFNearestNeighbor(**options)[source]¶
Bases:
NearestNeighborSurrogate model that approximates values using a RBF interpolator.
- interpolant¶
Interpolator object
- Type:
object
- options¶
Input keyword arguments for the interpolator.
- Type:
dict
- class cosapp.utils.surrogate_models.nearest_neighbor.WeightedNearestNeighbor(**options)[source]¶
Bases:
NearestNeighborSurrogate model that approximates values using a weighted interpolator.
- interpolant¶
Interpolator object
- Type:
object
- options¶
Input keyword arguments for the interpolator.
- Type:
dict