> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/sdgm/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/sdgm/_mcp/server.

# kumoai.encoder

> Encoder overrides for column-level preprocessing

While Kumo automatically infers encoders based on each column's `dtype` and `stype`, you can override the encoder for individual columns via [`ColumnProcessingPlan`](/sdk/kumoai-trainer#columnprocessingplan). The encoder you specify must be compatible with the column's semantic type.

***

## Enums

### `NAStrategy`

Strategy for imputing missing values.

| Value           | Description                                  |
| --------------- | -------------------------------------------- |
| `ZERO`          | Fill missing values with zero.               |
| `MEAN`          | Fill missing values with the column mean.    |
| `SEPARATE`      | Treat missing values as a separate category. |
| `MOST_FREQUENT` | Fill with the most frequent value.           |

***

### `Scaler`

Scaling strategy for numerical features.

| Value      | Description                                                          |
| ---------- | -------------------------------------------------------------------- |
| `STANDARD` | Z-score normalization (equivalent to scikit-learn `StandardScaler`). |
| `MINMAX`   | Min-max scaling to \[0, 1] (equivalent to `MinMaxScaler`).           |
| `ROBUST`   | Robust scaling using median and IQR (equivalent to `RobustScaler`).  |

***

## Encoders

### `Null`

Skips encoding for the column entirely. Supported on all semantic types.

```python
from kumoai.encoder import Null

encoder = Null()
```

***

### `Numerical`

Encodes a numerical column with optional scaling and missing value imputation.

```python
from kumoai.encoder import Numerical, Scaler, NAStrategy

encoder = Numerical(scaler=Scaler.STANDARD, na_strategy=NAStrategy.MEAN)
```

The scaling strategy. Kumo infers a suitable scaler if not specified.

The missing value imputation strategy.

***

### `MaxLogNumerical`

Applies a log transformation after clipping values at the column maximum. Useful for heavy-tailed distributions.

```python
from kumoai.encoder import MaxLogNumerical, NAStrategy

encoder = MaxLogNumerical(na_strategy=NAStrategy.MEAN)
```

The missing value imputation strategy.

***

### `MinLogNumerical`

Applies a log transformation after clipping values at the column minimum.

```python
from kumoai.encoder import MinLogNumerical, NAStrategy

encoder = MinLogNumerical(na_strategy=NAStrategy.MEAN)
```

The missing value imputation strategy.

***

### `Index`

Encodes a categorical or ID column as a learned embedding index. Rare values (below `min_occ`) are mapped to a shared out-of-vocabulary embedding.

```python
from kumoai.encoder import Index, NAStrategy

encoder = Index(min_occ=2, na_strategy=NAStrategy.SEPARATE)
```

Minimum occurrence count for a value to receive its own embedding. Values appearing fewer times are treated as out-of-vocabulary.

The missing value imputation strategy.

***

### `Hash`

Encodes a categorical column via feature hashing. Suitable for very high-cardinality columns.

```python
from kumoai.encoder import Hash

encoder = Hash(num_components=128)
```

The number of hash buckets (output dimensionality).

The missing value imputation strategy.

***

### `MultiCategorical`

Encodes a multi-categorical column (a string containing multiple space- or comma-separated categories) as a bag-of-categories embedding.

```python
from kumoai.encoder import MultiCategorical

encoder = MultiCategorical(min_occ=1)
```

Minimum occurrence count for a category to receive its own embedding.

The missing value imputation strategy.

***

### `GloVe`

Encodes a text column using pre-trained GloVe word embeddings.

```python
from kumoai.encoder import GloVe

encoder = GloVe(model_name="glove.6B", embedding_dim=50)
```

The GloVe model identifier. Valid values: `"glove.6B"`, `"glove.42B"`, `"glove.840B"`, `"glove_twitter.27B"`.

The embedding dimensionality.

The missing value imputation strategy.

***

### `NumericalList`

Encodes a sequence or embedding column (a list of floats) with optional scaling.

```python
from kumoai.encoder import NumericalList

encoder = NumericalList()
```

The scaling strategy applied to each element.

The missing value imputation strategy.

***

### `Datetime`

Encodes a timestamp column by decomposing it into cyclical calendar features. Each component is optional and enabled by default.

```python
from kumoai.encoder import Datetime

encoder = Datetime(include_year=True, include_day_of_week=True)
```

Include the minute-of-hour component.

Include the hour-of-day component.

Include the day-of-week component.

Include the day-of-month component.

Include the day-of-year component.

Include the year component.

If specified, encodes year as a cyclical feature over this many periods.

The missing value imputation strategy.