AddCategoryCounts#

class sdm.processing.categorical.AddCategoryCounts(min_cardinality: int = 0)#

Bases: Processor

Add the log row count of each categorical value.

Each eligible column receives one numerical column <column>__count holding log1p of the number of fitted rows sharing the row’s code. Negative codes (missing or unknown values) share one count.

Transform inputs must use the fitted per-column category vocabularies. Use AlignCategories before this processor when training and transform inputs were tensorized independently.

Parameters:

min_cardinality (int) – A count column is added when its fitted vocabulary size exceeds this value. Missing values do not contribute to vocabulary size. Defaults to 0.

Capabilities#

Handled Semantic Types

categorical

Requires Fitting

✅