def test_pearson_recommendations(_id, filtering): if filtering == 'user': ratings = read_ratings('ratingstest.csv') data = get_recommendations(ratings, _id, pearson_correlation) else: ratings = read_ratings('ratingstest.csv') item_based = read_item_based_data('pearsontest', pearson_correlation, ratings) data = get_recommended_items(ratings, item_based, _id) return jsonify(data)
def test_euclidean_recommendations(_id, filtering): if filtering == 'user': ratings = read_ratings('ratingstest.csv') data = get_recommendations(ratings, _id, euclidean_distance) else: ratings = read_ratings('ratingstest.csv') item_based = read_item_based_data('euclideantest', euclidean_distance, ratings) data = get_recommended_items(ratings, item_based, _id) return jsonify(data)
def user_matches(_id): """USER MATCHES""" data = top_matches(read_ratings('ratings.csv'), _id, 100, pearson_correlation) return jsonify(data)
def get_users_ratings(): """USERS RATINGS""" return jsonify(read_ratings('ratings.csv'))