LocalLeastSquares ¶
LocalLeastSquares(
search: Search | Sequence[Search],
*,
degree: int = 1,
variogram: Variogram | None = None,
)
Local polynomial of degree fitted to the neighbors.
unit
property
¶
unit
Unit of the estimates: that of the fitted values, ratio for probabilities; None if unknown.
cross_validate ¶
cross_validate(
*, folds: int | None = None
) -> CrossValidation
Re-estimates every sample from the others, through the same search passes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folds
|
int
|
Leave-one-out when None; otherwise k-fold, each sample estimated without the samples of its
fold. Samples fitted with |
None
|
fit ¶
fit(
coords,
values,
*,
holes=None,
error_variance=None,
domains=None,
domain_column=None,
)
Stores the samples. Samples sharing a location keep the first one, with a warning naming their holes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
(array_like, PointSet or BlockModel)
|
Sample locations, |
required |
values
|
array_like or str
|
Sample values, or their column in |
required |
holes
|
array_like or str
|
Drill-hole ids or names, for |
None
|
error_variance
|
array_like or str
|
Variance of each sample's measurement error, for data of different quality (kriging only). It is added to the sample's diagonal entry in the kriging system, so the estimate no longer honors a noisy value and leans towards its neighbors. Cokriging, disjunctive kriging and the simulators do not take it. |
None
|
domains
|
array_like
|
Domain label of each sample: strings, numbers or booleans. A target is then estimated from the
samples of its own domain, plus those of other domains within |
None
|
domain_column
|
str
|
The column of |
None
|
from_parquet
classmethod
¶
from_parquet(path)
Reads to_parquet output; predictions match the saved estimator's bit for bit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or PathLike
|
|
required |
Raises:
| Type | Description |
|---|---|
InvalidInput
|
If the file holds another class or a newer format. |
predict ¶
predict(
targets,
*,
return_variance: bool = False,
anisotropy=None,
diagnostics: bool = False,
domains=None,
domain_column=None,
)
Estimates at targets; NaN where the search found too few samples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
targets
|
(array_like, PointSet or BlockModel)
|
|
required |
return_variance
|
bool
|
Also return the kriging variance. |
False
|
anisotropy
|
LocalAnisotropy
|
Orients each target's variogram and search. |
None
|
diagnostics
|
bool
|
Return a Table instead: |
False
|
domains
|
array_like or label
|
Domain label of each target, or one label for all of them; required when fitted with domains. Targets of a domain without samples stay NaN. |
None
|
domain_column
|
str
|
The column of |
None
|
Returns:
| Type | Description |
|---|---|
ndarray, tuple of ndarray or Table
|
Estimates in |
to_parquet ¶
to_parquet(path) -> None
Writes the samples as Parquet columns and the parameters as JSON in the file metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or PathLike
|
|
required |
with_search ¶
with_search(search: Search | Sequence[Search])
A copy of the estimator, fitted samples included, with search in place of its searches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search
|
Search or sequence of Search
|
One search, or passes: targets one leaves unestimated go to the next. |
required |