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

IdentityScale

class
class IdentityScale(
min_val: ScaleIdentityLimitSpec,
max_val: ScaleIdentityLimitSpec,
use_bin_zero: bool = False,
)

Bases: Scale

Categories: dq-classifier

A scale with one bin per integer step over [min_val, max_val] (used with ScaleCategorizer).

Bin i holds the integer min_val + i. min_val itself shares bin 1 with min_val + 1, unless use_bin_zero is True: then it gets bin 0 and every integer in the range has its own bin.

Examples​

One bin per whole value in the range -- here a bin for each score from 1 to 5, with 1 in bin 0:

ScaleCategorizer(
["score"],
scale=IdentityScale(1, 5, use_bin_zero=True),
)

Parameters​

parameter
min_valScaleIdentityLimitSpec (StrictInt)

Lowest integer of the scale; a whole number.

parameter
max_valScaleIdentityLimitSpec (StrictInt)

Highest integer of the scale; a whole number strictly greater than min_val and no more than 100 above it (the span is the bin count).

parameter
use_bin_zerobool

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

Properties​

property
binsint

The number of bins, derived from the (min, max) range.