MonomialScale
class MonomialScale(
min_val: ScaleLimitSpec,
max_val: ScaleLimitSpec,
power: ScalePowerSpec,
bins: BinCountSpec = MAX_BINS,
use_bin_zero: bool = False,
)
Bases: Scale
Categories: dq-classifier
A power-law scale over [min_val, max_val] whose bin widths grow as
a power of the value (used with ScaleCategorizer).
Examples
Bins whose width grows with a power of the value, so small values are resolved more finely:
ScaleCategorizer(
["amount"],
scale=MonomialScale(0.0, 100.0, power=2.0, bins=10),
)
Parameters
parameter
max_valScaleLimitSpec (StrictInt | StrictFloat)Highest value of the scale; strictly greater than
min_val.
parameter
powerScalePowerSpec (StrictFloat)Exponent of the power-law spacing; a float greater than 0.
parameter
use_bin_zeroboolIf False, the minimum value belongs to the first
bin; if True, min_val gets its own bin 0.