ShuffleCategories#

class sdm.processing.categorical.ShuffleCategories(method: Literal['shift', 'random'] = 'random')#

Bases: EnsembleProcessor

Independently permute the integer codes of categorical columns.

One permutation per categorical column is drawn when the processor is fitted. Codes and their corresponding category vectors are permuted together so decoded values remain unchanged. Negative codes represent missing values and are preserved unchanged. Only categorical columns are supported; use StypeDispatch to apply this processor to the categorical block of a mixed feature table.

Parameters:

method (Literal['shift', 'random']) – Permutation strategy. "shift" cyclically shifts the codes by a drawn offset, and "random" remaps the codes with a drawn permutation.

Capabilities#

Handled Semantic Types

categorical

Requires Fitting

✅