A model you train to make recommendations based on item similarity, grouping, and, optionally, item ratings.
SDKs
- macOS 10.15+
- Xcode 11.0+
Framework
- Create ML
Declaration
struct MLRecommender
Overview
Use an MLRecommender
to train a machine learning model that you include in your app to make recommendations for the user, while keeping their data on-device.
You create a recommender model by training it with tabular data that includes columns for the recommendation items and the groups the items belong to. You also have the option to include an item rating column, which gives higher-rated items more weight than those with lesser or negative ratings. The recommender uses the training information to find similarity patterns by looking at items that occur in groups or have similar ratings within groups.
After you train a recommender, you save it as a Core ML model file with the .mlmodel
extension. Import this model file into your Xcode project by dragging it into the Project navigator. At runtime, use the recommender to make item suggestions to the user based on the patterns in training data and the user’s item history. For example, a hiking app can recommend trails based on the trails a user has previously hiked and their ratings of those trails.