示例#1
0
 public IEnumerable<KeyValuePair<int, double>> GetTopNItems(int userId,int n)
 {
     IPrediction userPrediction = new WeightedPrediction();
     Dictionary<int, double> allItemPrediction = userPrediction.GetAllItemsPrediction(userId);
     var topNItems = allItemPrediction
         .OrderByDescending(s => s.Value)
         .Take(n);
     return topNItems;
 }