# alibi\_detect.utils.discretizer

## `Discretizer`

### Constructor

```python
Discretizer(self, data: numpy.ndarray, categorical_features: List[int], feature_names: List[str], percentiles: List[int] = [25, 50, 75]) -> None
```

| Name                   | Type            | Default        | Description                                                                                                                                                                   |
| ---------------------- | --------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data`                 | `numpy.ndarray` |                | Data to discretize                                                                                                                                                            |
| `categorical_features` | `List[int]`     |                | List of indices corresponding to the categorical columns. These features will not be discretized. The other features will be considered continuous and therefore discretized. |
| `feature_names`        | `List[str]`     |                | List with feature names                                                                                                                                                       |
| `percentiles`          | `List[int]`     | `[25, 50, 75]` | Percentiles used for discretization                                                                                                                                           |

### Methods

#### `bins`

```python
bins(data: numpy.ndarray) -> List[numpy.ndarray]
```

Parameters

***

data Data to discretize

| Name   | Type            | Default | Description        |
| ------ | --------------- | ------- | ------------------ |
| `data` | `numpy.ndarray` |         | Data to discretize |

**Returns**

* Type: `List[numpy.ndarray]`

#### `discretize`

```python
discretize(data: numpy.ndarray) -> numpy.ndarray
```

Parameters

***

data Data to discretize

| Name   | Type            | Default | Description        |
| ------ | --------------- | ------- | ------------------ |
| `data` | `numpy.ndarray` |         | Data to discretize |

**Returns**

* Type: `numpy.ndarray`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.seldon.ai/alibi-detect/api-reference/utils/discretizer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
