The name, type, and constraints of an input or output feature.
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+Beta
- tvOS 11.0+
- watchOS 4.0+
- Core ML
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
MLFeature. Model authors use feature descriptions to help developers integrate their model properly. Each
MLFeature 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. Note the three input features named
size, and the output feature is named
price. All four features are of type
MLFeature 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.