示例#1
0
 private List <RecommendedItem> mostSimilarItems(long itemID,
                                                 IEnumerator <long> possibleItemIDs,
                                                 int howMany,
                                                 Rescorer <Tuple <long, long> > rescorer)
 {
     TopItems.Estimator <long> estimator = new MostSimilarEstimator(itemID, getSimilarity(), rescorer);
     return(TopItems.getTopItems(howMany, possibleItemIDs, null, estimator));
 }
        public IList <RecommendedItem> MostSimilarItems(Object itemID,
                                                        int howMany,
                                                        Rescorer <Pair <Item, Item> > rescorer)
        {
            if (rescorer == null)
            {
                throw new ArgumentNullException("rescorer is null");
            }
            Item toItem = this.DataModel.GetItem(itemID);

            TopItems.Estimator <Item> estimator = new MostSimilarEstimator(toItem, correlation, rescorer);
            return(DoMostSimilarItems(itemID, howMany, estimator));
        }
        public IList <User> MostSimilarUsers(Object userID,
                                             int howMany,
                                             Rescorer <Pair <User, User> > rescorer)
        {
            if (rescorer == null)
            {
                throw new ArgumentNullException("rescorer is null");
            }
            User toUser = this.DataModel.GetUser(userID);

            TopItems.Estimator <User> estimator = new MostSimilarEstimator(toUser, correlation, rescorer);
            return(DoMostSimilarUsers(userID, howMany, estimator));
        }
示例#4
0
 public List <RecommendedItem> mostSimilarItems(long itemID, int howMany, Rescorer <Tuple <long, long> > rescorer)
 {
     TopItems.Estimator <long> estimator = new MostSimilarEstimator(itemID, this.similarity, rescorer);
     return(this.doMostSimilarItems(new long[] { itemID }, howMany, estimator));
 }
示例#5
0
 public virtual long[] mostSimilarUserIDs(long userID, int howMany, Rescorer <Tuple <long, long> > rescorer)
 {
     TopItems.Estimator <long> estimator = new MostSimilarEstimator(userID, this.similarity, rescorer);
     return(this.doMostSimilarUsers(howMany, estimator));
 }