Class

MLModel

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

Overview

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.

Topics

Creating a Model

modelWithContentsOfURL:error:

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

Compiling a Model

compileModelAtURL:error:

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

Predicting Output Values

predictionFromFeatures:error:

Predicts output values from the given input features.

predictionFromFeatures:options:error:

Predicts output values from the given input features

predictionsFromBatch:options:error:

Predicts output values from the given batch of input features.

Beta
MLPredictionOptions

The options available when making a prediction.

Inspecting a Model

modelDescription

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

MLModelDescription

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

Relationships

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