Skip to main content
Version: 1.9.0

LinearScale

class LinearScale(
min_val: Annotated[int, Strict(strict=True)] | Annotated[float, Strict(strict=True)],
max_val: Annotated[int, Strict(strict=True)] | Annotated[float, Strict(strict=True)],
bins: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=100)])] = 100,
use_bin_zero: bool = False,
)

Bases: NonIdentityScale

Categories: dq-classifier

A linear scale.

Initializes a linear scale.

Parameters

parameter
min_val

The minimum value of the scale.

parameter
max_val

The maximum value of the scale.

parameter
bins

The number of bins to create.

parameter
use_bin_zero

If False, the minimum value is part of the first bin.

Properties

property
binsAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=100)])] | None

Returns the number of bins in the scale.

property
scale_rangetuple[Annotated[int, Strict(strict=True)] | Annotated[float, Strict(strict=True)], Annotated[int, Strict(strict=True)] | Annotated[float, Strict(strict=True)]]

Returns the (min, max) range of the scale.

property
use_bin_zerobool

Returns whether the minimum value is in bin zero or in bin one.