# weight to the KNN which yields more novelty and diversity;
# on the other hand if a user dislikes novel and diverse recommendations,
# we will assign more weight to the SVD algorithm, according to that user's
# preference in the hybrid approach
#
# here is an illustration of the hybrid approach we are describing. Assume the
# user preference towards diversity and novelty is 0.8
userPref_novel_diverse = 0.8  # could be computed and changed in the future

hybrid_weighted_algorithms = {
    'blKNN_tuned': knn_algo_dict['blKNN_tuned'],
    'SVD_tuned': mf_algo_dict['SVD_tuned']
}

# hybrid 1 with high novelty and diversity
hybrid_weighted_weights = {
    'blKNN_tuned': userPref_novel_diverse,
    'SVD_tuned': 1 - userPref_novel_diverse
}
hybrid_weighted = HybridAlgoWeighted(hybrid_weighted_algorithms,
                                     hybrid_weighted_weights)
evaluator.Add_Algo(hybrid_weighted, "hybrid")

# evaluate
evaluator.print(True)

# print recommendations for user
dummyUserID = 11
N = 5
evaluator.GenerateTopNRecs(dummyUserID, N)