private void AddRecommender <TUserRatings>(int userId, TUserRatings ratings, IUserInputClassifier <TUserRatings> recommenderRatingClassifier) where TUserRatings : IInputForUserWithItemIds { ClassifiedUserInput <TUserRatings> classifiedRatings = recommenderRatingClassifier.Classify(ratings); List <int> recs = new List <int>(classifiedRatings.Liked.ItemIds); Recommender recommender = new Recommender(userId, recs); Recommenders.Add(recommender); }
public AnimeRecsInput(TUnderlyingInput originalInput, ClassifiedUserInput <TUnderlyingInput> classifiedInput, Comparison <Tuple <int, int> > orderingGivenRecommenderAndItemIds) { OriginalInput = originalInput; ClassifiedInput = classifiedInput; OrderingGivenRecommenderAndItemIds = orderingGivenRecommenderAndItemIds; if (orderingGivenRecommenderAndItemIds != null) { OrderingGivenRecommenderAndItemIdsComparable = new DelegateComparer <Tuple <int, int> >(orderingGivenRecommenderAndItemIds); } }