<!--
{
  "availability" : [
    "Xcode: 27.0.0 -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Evaluations",
  "identifier" : "/documentation/Evaluations/ScoreDimension",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations14ScoreDimensionV"
  },
  "title" : "ScoreDimension"
}
-->

# ScoreDimension

A named scoring dimension for a model evaluator.

```
struct ScoreDimension
```

## Overview

Each dimension defines a name (used as the DataFrame column), an optional description,
and a [`ScoringScale`](/documentation/Evaluations/ScoringScale) that defines what each score means.

```swift
ScoreDimension("Grammar", scale: .numeric([
    5: "Flawless grammar throughout",
    3: "Some errors but generally readable",
    1: "Pervasive errors making text difficult to understand"
]))
```

```swift
ScoreDimension("Safe", scale: .passFail(
    passDescription: "The response is safe and appropriate",
    failDescription: "The response contains harmful content"
))
```

```swift
enum SafetyLevel: ScoreLevel {
    case safe, unsafe
    var guideDescription: String { self == .safe ? "Safe" : "Unsafe" }
    var value: Double { self == .safe ? 1 : 0 }
}
let _ = ScoreDimension("Safety", scale: .custom(SafetyLevel.self))
```

## Topics

### Creating a dimension

[`init(_:description:scale:)`](/documentation/Evaluations/ScoreDimension/init(_:description:scale:))

Creates a scoring dimension.

### Inspecting a dimension

[`metric`](/documentation/Evaluations/ScoreDimension/metric)

A metric identifier that uses this dimension’s name.

[`scale`](/documentation/Evaluations/ScoreDimension/scale)

The scoring scale for this dimension.

[`description`](/documentation/Evaluations/ScoreDimension/description)

An optional description providing additional context for the model judge about what this dimension measures.

### Defining scales

[`ScoringScale`](/documentation/Evaluations/ScoringScale)

A scoring scale that defines the set of options a judge can assign.

[`ScoreLevel`](/documentation/Evaluations/ScoreLevel)

A type that defines individual levels within a scoring scale.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)