---
title: "index(before:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/classificationdistribution/index(before:)"
---

# index(before:)

Returns the index immediately before an element index.

## Declaration

```swift
func index(before i: Int) -> Int
```

## Parameters

- `i`: A valid index to an element in the classification distribution.

## See Also

### Getting the index

- [index(after:)](createmlcomponents/classificationdistribution/index(after:).md)
