Surprise icon indicating copy to clipboard operation
Surprise copied to clipboard

How to find the compute_similarities() of neighbours in KNNMean() Algorithm

Open KhizarSultan opened this issue 3 years ago • 1 comments

Description

I have implemented the KNNMean() algorithm for product recommendations. It is working fine and for the evaluation of the model, I have extracted the neighbors of each customer using algo.get_neighbors(toy_story_inner_id, k=10) function but I want to know the similarity score of each neighbor, how can I find the similarity score of the neighbors?

Versions

image

KhizarSultan avatar Feb 17 '22 16:02 KhizarSultan

It's not supported but you can just copy paste the code of the get_neighbors method and return the others list right after this line:

https://github.com/NicolasHug/Surprise/blob/46b9914995e6c8c7d227b46f2eaeef2d4600580f/surprise/prediction_algorithms/algo_base.py#L285

NicolasHug avatar Feb 17 '22 16:02 NicolasHug