public RecommendationEvaluator(IBookRecommender recommender, INearestNeighborsSearch nearestNeighbors,
                                ICollaborativeFilteringHelpers helpers, IUsersSelector selector)
 {
     _recommender      = recommender;
     _nearestNeighbors = nearestNeighbors;
     _helpers          = helpers;
     _selector         = selector;
 }
Exemple #2
0
        public UserBasedCollaborativeFilteringTests()
        {
            _nearestNeighbors = Substitute.For <INearestNeighborsSearch>();
            _recommender      = Substitute.For <IBookRecommender>();
            _selector         = Substitute.For <IUsersSelector>();
            _settings         = new TestSettings();

            _sut = new UserBasedCollaborativeFiltering(_recommender, _nearestNeighbors, _selector);
        }
Exemple #3
0
 public UserBasedCollaborativeFiltering(
     IBookRecommender recommender,
     INearestNeighborsSearch nearestNeighbors,
     IUsersSelector selector)
 {
     _recommender      = recommender;
     _nearestNeighbors = nearestNeighbors;
     _selector         = selector;
 }
 public BookRecommenderTests()
 {
     _helpers  = new TestHelpers();
     _settings = new TestSettings
     {
         SimilarityDistance    = DistanceSimilarityEnum.PearsonSimilarity,
         NumOfNeighbors        = 2,
         NumOfBooksToRecommend = 1
     };
     _context = Substitute.For <IDataManager>();
     _sut     = new BookRecommender(_settings, _context);
 }
Exemple #5
0
        public RecommendationEvaluatorTests()
        {
            _nearestNeighbors = Substitute.For <INearestNeighborsSearch>();
            _recommender      = Substitute.For <IBookRecommender>();
            _selector         = Substitute.For <IUsersSelector>();
            _testHelpers      = new TestHelpers();
            _cfHelpers        = Substitute.For <ICollaborativeFilteringHelpers>();
            _settings         = new TestSettings
            {
                Id = 1
            };

            _sut = new RecommendationEvaluator(_recommender, _nearestNeighbors, _cfHelpers, _selector);
        }