Creates a classifier from a training set represented by a data source.
- macOS 10.14+
- Xcode 10.0+
- Create ML
The labeled images that you use to train this model, contained in a data source.
Parameters that you use to configure model training.
When you create an
MLImage instance, initialize it with an
MLImage structure. This allows you to configure the image classifier training process. For example, you can explicitly define the validation data set instead of allowing the model to choose a random selection of your training data. Alternatively, as shown in the following example, set
nil to allow the classifier to choose the validation data for you from among your training data. This lets you set other parameters—like maximum iterations and augmentation options—to non-default values.
Use the parameter structure and your training data to build a classifier. The following example uses training data from labeled directories within a directory called
Training,which resides in the
Training begins immediately.