Contents

MLFeatureValue

A generic wrapper around an underlying value and the value’s type.

Declaration

class MLFeatureValue

Overview

A Core ML feature value wraps an underlying value and bundles it with that value’s type, which is one of the types that MLFeatureType defines. Apps typically access feature values indirectly by using the methods in the wrapper class Xcode automatically generates for Core ML model files.

If your app accesses an MLModel directly, it must create and consume MLFeatureProvider instances. For each prediction, Core ML accepts a feature provider for its inputs, and generates a separate feature provider for its outputs. The input feature provider contains one MLFeatureValue instance per input, and the output feature provider contains one per output. See MLFeatureDescription for more information about the model input and output features.

Topics

Creating a feature value

Creating numeric feature values

Creating string feature values

Creating multidimensional feature values

Creating collection feature values

Creating image feature values

Creating undefined feature values

Accessing the feature’s type

Accessing the feature’s value

Comparing feature values

Supporting types

Initializers

Default Implementations

See Also

Model inputs and outputs