A model you train to make recommendations based on item similarities, and optionally, user ratings.
- macOS 10.15+Beta
- Xcode 11.0+Beta
- Create ML
MLRecommender to train a machine learning model you include in your app to make recommendations for the user, while keeping their data on-device.
When you create a recommender model, you train it with tabular data that includes columns for item and user identifiers. Optionally, you can also include a rating column which is a score of that activity by the user listed in that row. The recommender uses all other columns to look for similarities between items. For example, you can provide the recommender model with a data table of Yosemite hiking trail names (items), hiker ID numbers (user identifiers), and each hiker’s ratings of the trails. The remaining columns, which the recommender uses to determine item similarity, might contain trail attributes, such as hiking distance, average elevation, elevation gain, and difficulty.
After you train a recommender, you save it as a Core ML model file with the
.mlmodel extension. You can then import this model file into an app that uses a recommender model to make on-device recommendations, given the user’s history of items and their ratings. For example, a hiking app can recommend hiking trails based on the trails the user has already hiked and their ratings of those trails.