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

# MLFeatureDescription

The name, type, and constraints of an input or output feature.

```
class MLFeatureDescription
```

## Overview

In Core ML, a *feature* is a single input or output of a model. A model can have any number of *input features* or *output features*. Each feature has a name and a value type, which are defined in the feature’s `MLFeatureDescription`. Model authors use feature descriptions to help developers integrate their model properly. Each `MLFeatureDescription` instance has read-only properties that indicate the feature’s name, its type, and whether it’s optional.

For examples of features, see [Integrating a Core ML Model into Your App](/documentation/CoreML/integrating-a-core-ml-model-into-your-app). Note the three input features named `solarPanels`, `greenhouses`, and `size`, and the output feature is named `price`. All four features are of type `Double`.

An `MLFeatureDescription` may also include constraints, which specify the limitations of the model’s input and output features. For each input feature, the constraints describe what values the model expects from your app. For each output feature, the constraints describe what values your app should expect from the model. You can also write code to inspect these descriptions before using the model in your app.

## Topics

### Inspecting a feature

[`name`](/documentation/CoreML/MLFeatureDescription/name)

The name of this feature.

[`type`](/documentation/CoreML/MLFeatureDescription/type)

The type of this feature.

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

The possible types for feature values, input features, and output features.

[`isOptional`](/documentation/CoreML/MLFeatureDescription/isOptional)

A Boolean value that indicates whether this feature is optional.

### Checking for validity

[`isAllowedValue(_:)`](/documentation/CoreML/MLFeatureDescription/isAllowedValue(_:))

Checks whether the model will accept an input feature value.

### Accessing feature constraints

[`stateConstraint`](/documentation/CoreML/MLFeatureDescription/stateConstraint)

The state feature value constraint.

[`imageConstraint`](/documentation/CoreML/MLFeatureDescription/imageConstraint)

The size and format constraints for an image feature.

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

The width, height, and pixel format constraints of an image feature.

[`dictionaryConstraint`](/documentation/CoreML/MLFeatureDescription/dictionaryConstraint)

The constraint for a dictionary feature.

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

The constraint on the keys for a dictionary feature.

[`multiArrayConstraint`](/documentation/CoreML/MLFeatureDescription/multiArrayConstraint)

The constraints on a multidimensional array feature.

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

The shape and data type constraints for a multidimensional array feature.

[`sequenceConstraint`](/documentation/CoreML/MLFeatureDescription/sequenceConstraint)

The constraints for a sequence feature.

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

The constraints for a sequence feature.



---

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)