> ## Documentation Index
> Fetch the complete documentation index at: https://aidflow.aigensys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Predictor.cat_encode

**def Predictor.cat\_encode**(self, data=None, subset=None) [\[source\]](https://github.com/aigensys-labs/aidflow/blob/main/AID/\TRUENAS\aig_modeling_Products\AID\1_0_Lib\AID\predictor\predictor.py#L383)

Apply trained categorical encoding to input data.

#### Parameters

**`data`** : *`pDF | None`*
Input data. If None, returns the trained encoding\
map (category → code per variable).

**`subset`** : *`list`*
Specific features to process and return.\
Default = None: all trained features.

#### Returns

*`CatEncoderResult | dict`*
• data provided: data of encoded categorical features\
• data is None: trained category mappings


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.