Thank you very much for your help!
I was adjusting the cosine using the users' mean and I didn´t know that the items' mean was more effective. I read your blog post and it was very clear and informative.
Regarding the cosine implementation, I believe that I am calculating it the same way as you do. If I understand correctly, imagining that we have two item vectors A= [2,0,1,0] and B = [0,0,3,0], the cosine computation would consider it as if A would be [2,1] and B=[0,3], instead of considering the user who rated both items, [1] and [3]. Is my understanding correct?
I suppose that the difference in the implementations may be in how It behaves when the prediction is considered impossible. I read in your docs that the algorithm should return np.nan in those cases. In my case, I return np.nan when: 1) the user doesn't exist in the system; 2) the item doesn't exist in the system; 3) the algorithm did not find at least min_nbrs for that item. But how is the model supposed to behave when the active user did not rate any of the neighbourhood items?
Once again, I really appreciate your help. I am learning a lot.
Miguel