---
title: "category(at:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/onehotencoder/transformer/category(at:)"
---

# category(at:)

Retrieves the category at the one-hot encoding index.

## Declaration

```swift
func category(at index: Int) -> Category?
```

## Parameters

- `index`: The index of the category.

## Return Value

Return Value The category at the specified index.

## See Also

### Getting the categories

- [categories](createmlcomponents/onehotencoder/transformer/categories.md)
