public void testTopUsers()
        {
            long[] ids = new long[100];
            for (int i = 0; i < 100; i++)
            {
                ids[i] = i;
            }
            var possibleItemIds = ((IEnumerable <long>)ids).GetEnumerator();

            TopItems.IEstimator <long> estimator = new TestTopItemsEstimator();

            long[] topItems = TopItems.GetTopUsers(10, possibleItemIds, null, estimator);
            int    gold     = 99;

            foreach (long topItem in topItems)
            {
                Assert.AreEqual(gold--, topItem);
            }
        }
Beispiel #2
0
        private long[] doMostSimilarUsers(int howMany, TopItems.IEstimator <long> estimator)
        {
            IDataModel model = GetDataModel();

            return(TopItems.GetTopUsers(howMany, model.GetUserIDs(), null, estimator));
        }