Class RecommenderEvaluatorMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues>
A mapping used by an evaluator of recommenders.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Learners.Mappings
Assembly: Microsoft.ML.Probabilistic.Learners.Recommender.dll
Syntax
public class RecommenderEvaluatorMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues> : IRecommenderEvaluatorMapping<TInstanceSource, TUser, TItem, TRating>
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. |
| TRating | The type of a rating. |
| TFeatureSource | The type of a feature source. |
| TFeatureValues | The type of the feature values. |
Constructors
RecommenderEvaluatorMapping(IRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues>)
Initializes a new instance of the RecommenderEvaluatorMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues> class.
Declaration
public RecommenderEvaluatorMapping(IRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues> mapping)
Parameters
| Type | Name | Description |
|---|---|---|
| IRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues> | mapping | A recommender mapping. |
Methods
GetItems(TInstanceSource)
Gets the list of items from a given instance source.
Declaration
public IEnumerable<TItem> GetItems(TInstanceSource instanceSource)
Parameters
| Type | Name | Description |
|---|---|---|
| TInstanceSource | instanceSource | The instance source to get the list of items from. |
Returns
| Type | Description |
|---|---|
| IEnumerable<TItem> | The list of items. |
GetItemsRatedByUser(TInstanceSource, TUser)
Gets the list of items rated by a particular user.
Declaration
public IEnumerable<TItem> GetItemsRatedByUser(TInstanceSource instanceSource, TUser user)
Parameters
| Type | Name | Description |
|---|---|---|
| TInstanceSource | instanceSource | The instance source to get the list of items from. |
| TUser | user | The user who rated the items of interest. |
Returns
| Type | Description |
|---|---|
| IEnumerable<TItem> | The list of items rated by the user. |
GetRating(TInstanceSource, TUser, TItem)
Gets the rating given by a user to an item.
Declaration
public TRating GetRating(TInstanceSource instanceSource, TUser user, TItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| TInstanceSource | instanceSource | The instance source to get the rating from. |
| TUser | user | The user. |
| TItem | item | The item. |
Returns
| Type | Description |
|---|---|
| TRating | The rating. |
GetUsers(TInstanceSource)
Gets the list of users from a given instance source.
Declaration
public IEnumerable<TUser> GetUsers(TInstanceSource instanceSource)
Parameters
| Type | Name | Description |
|---|---|---|
| TInstanceSource | instanceSource | The instance source to get the list of users from. |
Returns
| Type | Description |
|---|---|
| IEnumerable<TUser> | The list of users. |
GetUsersWhoRatedItem(TInstanceSource, TItem)
Gets the list of users who rated a particular item.
Declaration
public IEnumerable<TUser> GetUsersWhoRatedItem(TInstanceSource instanceSource, TItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| TInstanceSource | instanceSource | The instance source to get the list of users from. |
| TItem | item | The item rated by the users of interest. |
Returns
| Type | Description |
|---|---|
| IEnumerable<TUser> | The list of users who rated the item. |