Interface IRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TFeatureSource, TFeatureValues>
A mapping used by the implementations of the IRecommender<TInstanceSource, TUser, TItem, TRating, TRatingDistribution, TFeatureSource> interface which operate on positive-only data.
Namespace: Microsoft.ML.Probabilistic.Learners.Mappings
Assembly: Microsoft.ML.Probabilistic.Learners.dll
Syntax
public interface IRecommenderMapping<in TInstanceSource, TInstance, TUser, TItem, in TFeatureSource, out TFeatureValues>
Type Parameters
Name | Description |
---|---|
TInstanceSource | The type of a source of instances. |
TInstance | The type of an instance |
TUser | The type of a user. |
TItem | The type of an item. |
TFeatureSource | The type of a feature source. |
TFeatureValues | The type of the feature values. |
Methods
GetInstances(TInstanceSource)
Retrieves a list of instances from a given instance source.
Declaration
IEnumerable<TInstance> GetInstances(TInstanceSource instanceSource)
Parameters
Type | Name | Description |
---|---|---|
TInstanceSource | instanceSource | The source to retrieve instances from. |
Returns
Type | Description |
---|---|
IEnumerable<TInstance> | The list of retrieved instances. |
GetItem(TInstanceSource, TInstance)
Extracts an item from a given instance.
Declaration
TItem GetItem(TInstanceSource instanceSource, TInstance instance)
Parameters
Type | Name | Description |
---|---|---|
TInstanceSource | instanceSource | The source of instances providing the |
TInstance | instance | The instance to extract the item from. |
Returns
Type | Description |
---|---|
TItem | The extracted item. |
GetItemFeatures(TFeatureSource, TItem)
Provides the features for a given item.
Declaration
TFeatureValues GetItemFeatures(TFeatureSource featureSource, TItem item)
Parameters
Type | Name | Description |
---|---|---|
TFeatureSource | featureSource | The source of the features. |
TItem | item | The item to provide the features for. |
Returns
Type | Description |
---|---|
TFeatureValues | The features for |
GetUser(TInstanceSource, TInstance)
Extracts a user from a given instance.
Declaration
TUser GetUser(TInstanceSource instanceSource, TInstance instance)
Parameters
Type | Name | Description |
---|---|---|
TInstanceSource | instanceSource | The source of instances providing the |
TInstance | instance | The instance to extract the user from. |
Returns
Type | Description |
---|---|
TUser | The extracted user. |
GetUserFeatures(TFeatureSource, TUser)
Provides the features for a given user.
Declaration
TFeatureValues GetUserFeatures(TFeatureSource featureSource, TUser user)
Parameters
Type | Name | Description |
---|---|---|
TFeatureSource | featureSource | The source of the features. |
TUser | user | The user to provide the features for. |
Returns
Type | Description |
---|---|
TFeatureValues | The features for |