idw
py3dinterpolations.modelling.models.idw
¶
Vectorized Inverse Distance Weighting (IDW) model.
IDWModel(power=1.0, threshold=1e-10)
¶
Bases: BaseModel
Vectorized IDW interpolation.
Uses numpy broadcasting instead of Python loops for ~1000x speedup on typical workloads. Batches computation for memory safety.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
power
|
float
|
Power parameter controlling distance decay. Higher values give more weight to nearby points. |
1.0
|
threshold
|
float
|
Distance below which a point is treated as coincident with a training point (exact interpolation). |
1e-10
|
Source code in py3dinterpolations/modelling/models/idw.py
25 26 27 28 29 | |
fit(x, y, z, v)
¶
Store training data.
Source code in py3dinterpolations/modelling/models/idw.py
31 32 33 34 | |
predict(grid_x, grid_y, grid_z, **kwargs)
¶
Predict on a regular grid defined by 1D arrays.
Returns:
| Type | Description |
|---|---|
InterpolationResult
|
InterpolationResult with shape (len(grid_z), len(grid_y), len(grid_x)) |
InterpolationResult
|
to match pykrige's output convention. |
Source code in py3dinterpolations/modelling/models/idw.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |