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 |
required |
metal_removed
|
float
|
Cap removing this fraction of the metal, |
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, |
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 |
required |
domains
|
array_like
|
Domain of each value, int or str. |
None
|
domain_column
|
str
|
Column of |
None
|
weights
|
array_like or str
|
Declustering weights; default the volumes of a BlockModel |
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.
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