Protocol

MLIdentifier

A type the Create ML framework can use as a machine learning identifier.

Declaration

protocol MLIdentifier

Overview

You can use any type that conforms to the MLIdentifier protocol, typically Int or String, to uniquely identify users and items in these MLRecommender methods:

Topics

Getting an Identifier

var identifierValue: MLDataValue

The value of the unique identifier wrapped in a data value.

Required.

Relationships

Conforming Types

See Also

Testing a Recommender

func recommendations<T>(fromUsers: MLDataColumn<T>, maxCount: Int, restrictingToItems: MLDataColumn<T>?, excluding: MLDataTable?, excludingObserved: Bool) -> MLDataTable

Retrieves the highest scored items for the given column of users, based on item similarity and the rating column.

func recommendations(fromUsers: [MLIdentifier], maxCount: Int, restrictingToItems: [MLIdentifier]?, excluding: MLDataTable?, excludingObserved: Bool) -> MLDataTable

Retrieves the highest scored item for the given array of users, based on item similarity and the rating column.

func getSimilarItems<T>(fromItems: MLDataColumn<T>, maxCount: Int) -> MLDataTable

Returns the top ranked similar items based on the model’s similarity type.

func getSimilarItems(fromItems: [MLIdentifier], maxCount: Int) -> MLDataTable

Returns the top ranked similar items based on the model’s similarity type.