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

# dataset.Dataset

> Dataset utilities for dataset management and manipulation utilities.

[View module source on GitHub](https://github.com/maximhq/maxim-py/blob/main/maxim/dataset/dataset.py)

#### create\_data\_structure

```python theme={null}
def create_data_structure(data_structure: DataStructure) -> DataStructure
```

Create and validate a data structure.

Takes a data structure, sanitizes it to ensure it meets validation requirements,
and returns the sanitized data structure.

**Arguments**:

| Name             | Type            | Description                                |
| ---------------- | --------------- | ------------------------------------------ |
| `data_structure` | *DataStructure* | The data structure to create and validate. |

**Returns**:

| Name            | Description                   |
| --------------- | ----------------------------- |
| `DataStructure` | The validated data structure. |

**Raises**:

* `Exception` - If the data structure contains validation errors (e.g., multiple
  input columns, multiple expected output columns, or multiple context
  to evaluate columns).

#### sanitize\_data\_structure

```python theme={null}
def sanitize_data_structure(data_structure: Optional[DataStructure]) -> None
```

Sanitize and validate a data structure for correctness.

Ensures that the data structure contains at most one of each required column type:

* InputColumn: Only one input column is allowed
* ExpectedOutputColumn: Only one expected output column is allowed
* ContextToEvaluateColumn: Only one context to evaluate column is allowed

**Arguments**:

| Name             | Type                       | Description                     |
| ---------------- | -------------------------- | ------------------------------- |
| `data_structure` | *Optional\[DataStructure]* | The data structure to sanitize. |

Can be None, in which case no validation is performed.

**Raises**:

* `Exception` - If the data structure contains more than one input column,
  more than one expected output column, or more than one context
  to evaluate column. The exception includes the full data structure
  for debugging purposes.

#### validate\_data\_structure

```python theme={null}
def validate_data_structure(data_structure: Dict[str, Any],
                            against_data_structure: Dict[str, Any]) -> None
```

Validate that a data structure matches the expected structure schema.

Ensures that all keys present in the provided data structure also exist
in the reference data structure (typically from the platform/dataset).
This prevents attempting to use columns that don't exist in the target dataset.

**Arguments**:

| Name                     | Type              | Description                     |
| ------------------------ | ----------------- | ------------------------------- |
| `data_structure`         | *Dict\[str, Any]* | The data structure to validate. |
| `against_data_structure` | *Dict\[str, Any]* | The reference data structure    |

to validate against (e.g., from the platform dataset).

**Raises**:

* `Exception` - If the provided data structure contains any keys that are
  not present in the reference data structure. The exception includes
  both the provided keys and the expected keys for debugging.
