Class TrainTestSplittingRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues>
Represents TrainTestSplittingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TFeatureSource, TFeatureValues> for rating based recommenders.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Learners.Mappings
Assembly: Microsoft.ML.Probabilistic.Learners.Recommender.dll
Syntax
public class TrainTestSplittingRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues> : TrainTestSplittingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TFeatureSource, TFeatureValues>, IRatingRecommenderMapping<SplitInstanceSource<TInstanceSource>, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues>, IRecommenderMapping<SplitInstanceSource<TInstanceSource>, TInstance, TUser, TItem, TFeatureSource, 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. |
TRating | The type of a rating. |
TFeatureSource | The type of a feature source. |
TFeatureValues | The type of the feature values. |
Constructors
TrainTestSplittingRatingRecommenderMapping(IRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues>, Double, Double, Double, Double, Double, Double, Boolean)
Initializes a new instance of the TrainTestSplittingRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues> class.
Declaration
public TrainTestSplittingRatingRecommenderMapping(IRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues> mapping, double trainingOnlyUserFraction, double testUserRatingTrainingFraction, double coldUserFraction = 0, double coldItemFraction = 0, double ignoredUserFraction = 0, double ignoredItemFraction = 0, bool removeOccasionalColdItems = false)
Parameters
Type | Name | Description |
---|---|---|
IRatingRecommenderMapping<TInstanceSource, TInstance, TUser, TItem, TRating, TFeatureSource, TFeatureValues> | mapping | The wrapped recommender mapping. |
Double | trainingOnlyUserFraction | The fraction of users included in the training set only. |
Double | testUserRatingTrainingFraction | The fraction of ratings in the training set for each user who is presented in both sets. |
Double | coldUserFraction | The fraction of users included in the test set only. |
Double | coldItemFraction | The fraction of items included in the test set only. |
Double | ignoredUserFraction | The fraction of users not included in either the training or the test set. |
Double | ignoredItemFraction | The fraction of items not included in either the training or the test set. |
Boolean | removeOccasionalColdItems | Whether the occasionally produced cold items should be removed from the test set. |
Methods
GetRating(SplitInstanceSource<TInstanceSource>, TInstance)
Extracts a rating from a given instance by delegating the call to the wrapped mapping.
Declaration
public TRating GetRating(SplitInstanceSource<TInstanceSource> instanceSource, TInstance instance)
Parameters
Type | Name | Description |
---|---|---|
SplitInstanceSource<TInstanceSource> | instanceSource | The instance source providing the |
TInstance | instance | The instance to extract the rating from. |
Returns
Type | Description |
---|---|
TRating | The extracted rating. |