Skip to content

Capping

Top-cut transform: clips values to a cap per domain.

Give exactly one of cap, quantile, metal_removed or cv. The rules choose each domain's cap from its own weighted values when fitted.

Parameters:

Name Type Description Default
cap float or dict

The cap, or a cap per domain; domains left out are not capped.

required
quantile float

Cap at the weighted quantile of this probability, as in describe.

required
metal_removed float

Cap removing this fraction of the metal, 1 - capped mean / mean, in [0, 1).

required
cv float

The largest cap whose capped coefficient of variation is at most this; the largest value when the data already are.

required

Attributes:

Name Type Description
caps_ float or dict

The cap, or the cap per domain when fitted with domains (inf when not capped).

metal_removed_ float or dict

Fraction of the metal removed, 1 - mean_capped / mean of capping_report, likewise.

fit method descriptor

fit(
    values,
    *,
    domains=None,
    domain_column=None,
    weights=None,
    data=None,
)

Fits the caps to values, per domain when given.

Parameters:

Name Type Description Default
values array_like or str

Values, or their column in data; NaN is skipped.

required
domains array_like

Domain of each value, int or str.

None
domain_column str

Column of data holding the domains; give it or domains.

None
weights array_like or str

Declustering weights; default the volumes of a BlockModel data, else 1.

None
data (PointSet, BlockModel, Table or dict)

Where column names are looked up.

None

fit_transform method descriptor

fit_transform(
    values,
    *,
    domains=None,
    domain_column=None,
    weights=None,
    data=None,
)

fit, then the fitted values capped.

from_json staticmethod

from_json(text)

Reads to_json output; raises InvalidInput on another class's JSON or a newer format.

to_json method descriptor

to_json()

JSON of the parameters and, once fitted, the fitted state.

transform method descriptor

transform(
    values, *, domains=None, domain_column=None, data=None
)

values clipped to the cap of their domain; values of a domain not fitted, and NaN, are unchanged.

used in