An encapsulation of all the details of your machine learning model.
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 11.0+
- watchOS 4.0+
- Core ML
MLModel encapsulates a model’s prediction methods, configuration, and model description.
In most cases, you can use Core ML without accessing the
MLModel class directly. Instead, use the programmer-friendly wrapper class that Xcode automatically generates when you add a model (see Integrating a Core ML Model into Your App). If your app needs the
MLModel interface, use the wrapper class’s
MLModel interface, you can:
Make a prediction with your app’s custom
Make multiple predictions with your app’s custom
If your app downloads and compiles a model on the user’s device, you must use the
MLModel class directly to make predictions. See Downloading and Compiling a Model on the User’s Device.