Skip to content

CategoricalIndicatorKriging

Indicator kriging of categories: the probability of each category kriged from its indicator, clipped to [0, 1] and rescaled to sum 1 at each target.

Parameters:

Name Type Description Default
variograms Variogram or sequence of Variogram

One indicator variogram per category, in code order, or a single one shared by all (one kriging system per target).

required
search Search or sequence of Search

Neighborhood shared by all categories; a sequence is searched in passes, each filling the targets the previous left unestimated. With no ellipsoid, the middle category's variogram orients it.

required
simple bool

Simple kriging with the declustered global proportions as means; ordinary kriging otherwise.

required
scheme Categories

Names and colors of the categories: fit then takes labels, encoded by it. Without it, fit takes codes 0..k.

required

names property

names

Category names: those of scheme, else the codes as strings.

cross_validate method descriptor

cross_validate(*, folds=None)

Re-estimates each sample's probabilities from the others, through the same search passes, each in its own domain, against the proportions of all samples.

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 holes keep their holes whole: the j-th of the sorted hole ids goes to fold j % folds, an untagged sample i to fold i % folds.

None

Returns:

Type Description
CategoricalCrossValidation

fit method descriptor

fit(
    coords,
    categories,
    *,
    weights=None,
    holes=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)
required
categories array_like or str

A category per sample: a label of scheme, or without it a code 0..k; or the column of coords holding them. So for the other per-sample arguments.

required
weights array_like or str

Declustering weights for the global proportions: the simple kriging means.

None
holes array_like or str

Drill-hole ids or names, for max_per_hole.

None
domains array_like

Domain label of each sample. A target is then estimated from the samples of its own domain, plus those of other domains within Search soft; predict then needs domains too.

None
domain_column str

The column of coords holding the domains; instead of domains.

None

from_parquet staticmethod

from_parquet(path)

Reads to_parquet output; raises InvalidInput on another class's file or a newer format.

predict method descriptor

predict(
    targets,
    *,
    domains=None,
    domain_column=None,
    anisotropy=None,
    diagnostics=False,
)

Probability of each category at each target.

Parameters:

Name Type Description Default
targets (array_like, PointSet or BlockModel)
required
domains array_like

Domain label of each target, or one label for all; a domain without samples is left unestimated.

None
domain_column str

The column of targets holding the domains; instead of domains.

None
anisotropy LocalAnisotropy

Orients every category's variogram and the search at each target.

None
diagnostics bool

Fill CategoricalIndicatorSummary.diagnostics.

False

Returns:

Type Description
CategoricalIndicatorSummary

NaN where the search found too few samples.

to_parquet method descriptor

to_parquet(path)

Writes samples and weights as Parquet columns and parameters as JSON in the file metadata; from_parquet reads it back.

used in