public static List <Item> Get(string algo, int userId, int contentId, int take) { List <Item> items = new List <Item>(); switch (algo) { case "assoc": items = RecommendationHelper.AssociationRecommendationByUser(userId, take); break; case "top": items = RecommendationHelper.TopRecommendation(userId, take); break; case "random": items = GetRandom(take); break; case "collab": List <int?> precRecs2 = RecommendationHelper.CollaborativeBasedRecommendation(userId, take); if (precRecs2.Count > 0) { items = GetItemsByImdbIds(precRecs2); } break; } return(items); }
public static List <Item> Get(string algo, int userId, int take) { List <Item> items = new List <Item>(); switch (algo) { case "top": items = RecommendationHelper.TopRecommendation(userId, take); break; case "random": items = GetRandom(take); break; } return(items); }
public static List <Item> GetViaFunction(string algo, int userId, int contentId, int take) { List <Item> items = new List <Item>(); items = RecommendationHelper.Get(algo, userId, contentId, take); if (items == null) { return(new List <Item>()); } if (items.Count > take) { items = items.Take <Item>(take).ToList(); } return(items); }