ExponentialScale
class ExponentialScale(
min_val: ScaleLimitSpec,
max_val: ScaleLimitSpec,
base: ScaleBaseSpec = math.e,
bins: BinCountSpec = MAX_BINS,
use_bin_zero: bool = False,
)
Bases: Scale
Categories: dq-classifier
A scale whose bin edges are spaced exponentially over
[min_val, max_val] (used with ScaleCategorizer).
The edges grow geometrically, so the bins widen as values grow, the
mirror of LogarithmicScale. A range with min_val <= 0 is shifted to
positive values before the edges are computed.
Examples
Bins that widen as values grow -- useful for long-tailed values. Here the edges are 10, 100 and 1000:
ScaleCategorizer(
["amount"],
scale=ExponentialScale(1.0, 1000.0, base=10.0, bins=3),
)
Parameters
parameter
max_valScaleLimitSpec (StrictInt | StrictFloat)Highest value of the scale; strictly greater than
min_val.
parameter
use_bin_zeroboolIf False, the minimum value belongs to the first
bin; if True, min_val gets its own bin 0.