Skip to content

assign_domain builtin

assign_domain(
    targets,
    *,
    coords=None,
    domains=None,
    domain_column=None,
    method="nearest",
    mesh=None,
    n=5,
)

Domain of each target from labeled samples, or inside/outside a closed mesh.

Parameters:

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

(n, 2|3) points, or the centroids of a point set or block model.

required
coords (array_like, PointSet or BlockModel)

Sample locations, for nearest and majority.

None
domains array_like of str

Sample labels; or give domain_column.

None
domain_column str

Column of coords holding the sample labels.

None
method (nearest, majority, solid)

nearest: the label of the nearest sample. majority: the most frequent label among the n nearest samples; a tie goes to the label of the nearest sample. Samples at equal distance rank by label. solid: "inside" or "outside" of mesh.

"nearest"
mesh Mesh

Closed mesh, for solid.

None
n int

Neighbors that vote and that the confidence is measured on.

5

Returns:

Name Type Description
labels list of str
confidence ndarray

Share of the n nearest samples (all of them when fewer) carrying the chosen label; 1 for solid.

used in