> For the complete documentation index, see [llms.txt](https://docs.seldon.ai/alibi-detect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seldon.ai/alibi-detect/api-reference/od/base.md).

# alibi\_detect.od.base

## `FittedTransformProtocol`

*Inherits from:* `TransformProtocol`, `Protocol`, `Generic`

Protocol for fitted transformer objects.

This protocol models the joint interface of the :py:obj:`~alibi_detect.od.pytorch.ensemble.BaseTransformTorch` class and the :py:obj:`~alibi_detect.od.pytorch.ensemble.FitMixinTorch` class. These objects are transforms that require to be fit.

### Methods

#### `check_fitted`

```python
check_fitted()
```

#### `fit`

```python
fit(x_ref)
```

| Name    | Type | Default | Description |
| ------- | ---- | ------- | ----------- |
| `x_ref` |      |         |             |

#### `set_fitted`

```python
set_fitted()
```

## `TransformProtocol`

*Inherits from:* `Protocol`, `Generic`

Protocol for transformer objects.

The :py:obj:`~alibi_detect.od.pytorch.ensemble.BaseTransformTorch` object provides abstract methods for objects that map between `torch` tensors. This protocol models the interface of the `BaseTransformTorch` class.

### Constructor

```python
TransformProtocol(self, *args, **kwargs)
```

### Methods

#### `transform`

```python
transform(x)
```

| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| `x`  |      |         |             |

## Functions

### `get_aggregator`

```python
get_aggregator(aggregator: Union[alibi_detect.od.base.TransformProtocol, Literal[TopKAggregator, AverageAggregator, MaxAggregator, MinAggregator]]) -> alibi_detect.od.base.TransformProtocol
```

| Name         | Type                                                                                                                      | Default | Description |
| ------------ | ------------------------------------------------------------------------------------------------------------------------- | ------- | ----------- |
| `aggregator` | `Union[alibi_detect.od.base.TransformProtocol, Literal[TopKAggregator, AverageAggregator, MaxAggregator, MinAggregator]]` |         |             |

**Returns**

* Type: `alibi_detect.od.base.TransformProtocol`

### `get_normalizer`

```python
get_normalizer(normalizer: Union[alibi_detect.od.base.TransformProtocol, alibi_detect.od.base.FittedTransformProtocol, Literal[PValNormalizer, ShiftAndScaleNormalizer]]) -> alibi_detect.od.base.TransformProtocol
```

| Name         | Type                                                                                                                                            | Default | Description |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----------- |
| `normalizer` | `Union[alibi_detect.od.base.TransformProtocol, alibi_detect.od.base.FittedTransformProtocol, Literal[PValNormalizer, ShiftAndScaleNormalizer]]` |         |             |

**Returns**

* Type: `alibi_detect.od.base.TransformProtocol`
