ScaleCategorizer
class ScaleCategorizer(
column_names: str | tuple[str, str | None] | Annotated[list[str], <class 'Strict'>] | Annotated[list[tuple[str, str | None]], <class 'Strict'>] | NoneType = None,
on_missing_column: Literal['ignore', 'fail'] = 'ignore',
on_wrong_type: Literal['ignore', 'fail'] = 'ignore',
on_wrong_scale_value: Literal['ignore', 'fail'] = 'ignore',
scale: Scale,
tags: str | list[str] | NoneType = None,
)
Bases: Categorizer
Categories: dq-classifier
A classifier that bucketizes data into bins based on a given scale.
Initializes a categorizer.
Parameters
column_namesThe column(s) to categorize.
on_missing_columnWhat to do if a column name is missing.
on_wrong_typeBehavior when a column’s type is incompatible with the classifier.
on_wrong_scale_valueBehavior when the scale's min or max values are incompatible with the column type.
scaleThe scale to use for categorization.
tagsOptional tags for the classifier.
Properties
column_nameslist[tuple[str, str | None]] | NoneReturns the list of columns the classifier applies to, including optional destination column names.
on_missing_columnLiteral['ignore', 'fail']Returns what do if the column is missing.
on_wrong_typeLiteral['ignore', 'fail']Returns what do if the column type is incompatible with the classifier.
on_wrong_valueLiteral['ignore', 'fail']Returns what do if the column type is incompatible with the classifier.
scaleScaleReturns the scale used for categorization.
tagslist[str] | NoneReturns the list of tags associated with the classifier.
Methods
supported_dtypesdef supported_dtypes() -> FrozenSet[Type]
Returns the set of data types supported by categorizers.