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

# Multivariate

> Represents custom features derived from multiple columns using clustering analysis.

Multivariate features combine multiple numeric columns into a single derived feature
using k-means clustering algorithms. This enables monitoring of multivariate drift
and detecting unusual combinations that might not be apparent when monitoring
columns individually.

The feature type is automatically set to CustomFeatureType.FROM\_COLUMNS and uses
clustering to group similar combinations of column values for drift detection.

## Examples

Creating a user behavior multivariate feature:

```python theme={null}
behavior_feature = Multivariate(
    name="user_engagement_cluster",
    columns=["page_views", "session_duration", "clicks"],
    n_clusters=8,
    monitor_components=True
)
```

Creating a system performance multivariate feature:

```python theme={null}
perf_feature = Multivariate(
    name="system_health",
    columns=["cpu_usage", "memory_usage", "response_time"],
    n_clusters=5,
    monitor_components=False
)
```

## Attributes

**type** `Literal['FROM_COLUMNS']`

Type discriminator; fixed as `CustomFeatureType.FROM_COLUMNS`.

**n\_clusters** `int | None`

Number of k-means clusters used for drift detection (default `5`).

**centroids** `List | None`

Cluster centroids in the embedded space; populated during training.

**columns** `List[str]`

Names of the input columns combined into this feature; at least two required.

**monitor\_components** `bool`

Whether to monitor each column individually for drift (default `False`).

## *classmethod* validate\_columns()

### Returns

`List[str]`

## *classmethod* validate\_n\_clusters()

### Returns

`int`
