def test_predict_rating(self): recommender = WeightedSumRecommender(SingleSimilarityMatrixBuilder('cosine')) recommender.load(reviews) actual_rating_1 = 4.0 self.assertEqual(actual_rating_1, recommender.predict_rating('A1', 1)) actual_rating_2 = 2.0 self.assertEqual(actual_rating_2, recommender.predict_rating('A1', 3))
def test_calculate_recommender_precision(self): recommender = WeightedSumRecommender( SingleSimilarityMatrixBuilder('euclidean')) recommender.load(reviews_matrix_5)
def test_calculate_recommender_precision(self): recommender = WeightedSumRecommender(SingleSimilarityMatrixBuilder('euclidean')) recommender.load(reviews_matrix_5)