Example #1
0
        public void testRecommender()
        {
            IRecommender             recommender = new ItemUserAverageRecommender(getDataModel());
            IList <IRecommendedItem> recommended = recommender.Recommend(1, 1);

            Assert.NotNull(recommended);
            Assert.AreEqual(1, recommended.Count);
            IRecommendedItem firstRecommended = recommended[0];

            Assert.AreEqual(2, firstRecommended.GetItemID());
            Assert.AreEqual(0.35151517f, firstRecommended.GetValue(), EPSILON);
            recommender.Refresh(null);
            Assert.AreEqual(2, firstRecommended.GetItemID());
            Assert.AreEqual(0.35151517f, firstRecommended.GetValue(), EPSILON);
        }
Example #2
0
 internal Estimator(ItemUserAverageRecommender itemUserAverageRecommender, long userID)
 {
     this.userID = userID;
     this.itemUserAverageRecommender = itemUserAverageRecommender;
 }