<!--
{
  "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/ModelJudgeEvaluator/pairwise(_:scale:judge:scoringMode:evaluationTarget:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations19ModelJudgeEvaluatorV8pairwise_5scale5judge11scoringMode16evaluationTargetACyxGSS_AA12ScoringScaleV16FoundationModels08LanguageB0_pAA0lI0OSS13ExpectedValueQzYbcSgtFZ"
  },
  "title" : "pairwise(_:scale:judge:scoringMode:evaluationTarget:)"
}
-->

# pairwise(_:scale:judge:scoringMode:evaluationTarget:)

Creates a pairwise comparison evaluator that compares the model’s response against the sample’s expected value.

```
static func pairwise(_ name: String, scale: ScoringScale, judge: any LanguageModel, scoringMode: ScoringMode = .discrete, evaluationTarget: (@Sendable (Input.ExpectedValue) -> String)? = nil) -> ModelJudgeEvaluator<Input>
```

## Parameters

`name`

The metric name that corresponds to the DataFrame column.

`scale`

Scoring scale for the comparison.

`judge`

The language model to use as judge.

`scoringMode`

A value that indicates whether scores are discrete (default) or allow any floating-point value.

`evaluationTarget`

An optional closure that converts the value to a string. Both responses use this target.

## Discussion

The judge sees the model’s output under “Response” and the expected value from `input.expected` under “Baseline Response” in the Context section.

---

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)