Skip to content

Nearest Neighbor🍋

NearestNeighbor 🍋

Bases: Entity

Nearest Neighbor Solver class.

Parameters:

Name Type Description Default
metric Metric

Metric used for distance computation.

required
axes List[Coord]

If solver is 2D or 3D. Defaults to [Coord.U, Coord.V, Coord.W].

[U, V, W]

Attributes:

Name Type Description
metric Metric

Metric used for distance computation.

axes List[Coord]

If solver is 2D or 3D.

axes property 🍋

Return Solver Axis.

Returns:

Type Description
List[Coord]

List of axes.

metric property 🍋

Return Solver Metric.

Returns:

Type Description
Metric

Solver Metric.

solve(obj, obj_region, obj_attribute, support, support_region, support_attribute) 🍋

Solve NearestNeighbor on a support using a conditioning object.

Parameters:

Name Type Description Default
obj GeoRefObject

Conditioning Object.

required
obj_region Optional[str]

Spatial subset of conditioning.

required
obj_attribute str

Property to estimate.

required
support GeoRefObject

Object to estimate onto.

required
support_region Optional[str]

Spatial subset of estimation.

required
support_attribute str

Property name to add in support.

required

solve_api(metric, dim, obj_coords, obj_data, support_coords) staticmethod 🍋

Low-level NearestNeighbor solving method.

Parameters:

Name Type Description Default
metric Metric

Metric used for distance computation.

required
dim int

Number of dimensions.

required
obj_coords ndarray

Conditioning object coordinates in region along specified axes.

required
obj_data ndarray

Values in selected region.

required
support_coords ndarray

Support coordinates in region along specified axes.

required

Returns:

Type Description
Tuple[ndarray, ndarray]

NearestNeighbor results and distance ndarrays.