<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLMetricKey",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLMetricKey"
  },
  "title" : "MLMetricKey"
}
-->

# MLMetricKey

A key for the metrics dictionary in an update context.

```
class MLMetricKey
```

## Topics

### Getting the keys

[`lossValue`](/documentation/CoreML/MLMetricKey/lossValue)

The key you use to access the current loss (a `float` value).

[`epochIndex`](/documentation/CoreML/MLMetricKey/epochIndex)

The key you use to access the epoch index (an `Int64` value).

[`miniBatchIndex`](/documentation/CoreML/MLMetricKey/miniBatchIndex)

The key you use to access the mini-batch index (an `Int64` value) within an epoch.

### Supporting types

[`MLKey`](/documentation/CoreML/MLKey)

An abstract base class for machine learning key types.



---

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)