An encapsulation of all the details of your machine learning model.


In many cases, you can use Core ML without accessing the MLModel class directly. Instead, the automatically generated model class (named after your .mlmodel file) provides a programmer friendly interface that you should use. If you do need an MLModel instance, use the model property on the automatically generated model class.

However, if you create your own MLFeatureProvider, you need to use the MLModel predictionFromFeatures:error: or predictionFromFeatures:options:error: directly.


Creating a Model


Creates a Core ML model, to be used only when not using the Xcode autogenerated interface.

Compiling a Model


Compiles a model on the device to update the model in your app.

Predicting Output Values


Predicts output values from the given input features.


Predicts output values from the given input features


Predicts output values from the given batch of input features.


The options available when making a prediction.

Inspecting a Model


Metadata about the model, which is also displayed in the Xcode view of the model.


Information about the model, primarily the expected input and output format, with additional optional metadata.


Inherits From

See Also

Machine Learning Model

Downloading and Compiling a Model on the User's Device

Distribute Core ML models to the user's device after the app is installed.

Making Predictions with a Sequence of Inputs

Integrate a recurrent neural network model to process sequences of inputs.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software