Hi,
Your answers can be found in the FAQ section of the Surprise library documentation. Those functionalities aren’t supported natively yet but there is a clear suggestion on how to get them.
For your first question on how to recommend items to users you can do the following.
- Define the
get_top_n()as defined here - Run the following on a
trainset
# Than predict ratings for all pairs (u, i) that are NOT in the training set.
testset = trainset.build_anti_testset()
predictions = algo.test(tests)3. Get the top 10 items for each top_n_dict=get_top_n(predictions, n=10) which returns a dictionary with uid as keys and top-N predictions as values. So getting top predictions for a user with internal raw ID 1234 should be something like top_n_dict[1234]
Concerning your second question about the most similar user I suggest you check the part of the FAQ here but this is specific to algorithms that uses similarity measures such as K-NN and not all algorithm. To my knowledge there is not general function to get similar users so far in Surprise. But keep an eye because it is being enhanced periodically.
