Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.API ReferenceCLI ReferenceRelease Notes
Version: 2.2.0

LogarithmicScale

class
class LogarithmicScale(
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 logarithmically over [min_val, max_val] (used with ScaleCategorizer).

The edges are the logarithms of evenly spaced points between base ** min_val and base ** max_val, so the bins narrow as values grow and values near max_val are resolved most finely.

Examples​

Bins that narrow as values grow -- here with edges at about 2.52, 2.82 and 3:

ScaleCategorizer(
["amount"],
scale=LogarithmicScale(0.0, 3.0, base=10.0, bins=3),
)

Parameters​

parameter
min_valScaleLimitSpec (StrictInt | StrictFloat)

Lowest value of the scale; an int or float.

parameter
max_valScaleLimitSpec (StrictInt | StrictFloat)

Highest value of the scale; strictly greater than min_val.

parameter
baseScaleBaseSpec (StrictFloat)

Base of the logarithm; a float greater than 0 (default e). base ** min_val and base ** max_val must not overflow a float.

parameter
binsBinCountSpec (StrictInt)

Number of bins; a whole number from 1 to 100 (default 100).

parameter
use_bin_zerobool

If False, the minimum value belongs to the first bin; if True, min_val gets its own bin 0.