Surprise icon indicating copy to clipboard operation
Surprise copied to clipboard

Add adjusted cosine similarity

Open NicolasHug opened this issue 6 years ago • 9 comments

As discussed in #135, it would be interesting to add support for the adjusted cosine similarity.

Adjusted cosine is similar to pearson similarity, only the centering differs (for a user-user similarity, we center with the item average instead of with the respective user averages).

NicolasHug avatar Apr 03 '18 15:04 NicolasHug

Is this issue still open ? Is there someone already working on it ?

mamadyonline avatar Apr 26 '18 22:04 mamadyonline

Yes it's still open so you're welcome to try if you want to. Don't forget to check the contributing guidelines :)

NicolasHug avatar Apr 27 '18 06:04 NicolasHug

Ok that is cool.

But it seems like there is already an implementation for it following the discussion in the issue #135 ??!!

mamadyonline avatar Apr 27 '18 17:04 mamadyonline

There's no PR related to adjusted cosine so you can go for it. One of the open PRs is related #164, but even then, it's only partially addressed.

Just to make it clear: implementing adjusted cosine should be done here only considering common ratings. I am aware that adjusted cosine is rather commonly computed on the whole ratings, but that can be dealt with once we address #164.

NicolasHug avatar Apr 27 '18 17:04 NicolasHug

Ok. Just to get it right, this would be similar to the actual implementation of cosine similiraty with common_ratings_only=True but with the shift at the mean right ?

mamadyonline avatar Apr 30 '18 03:04 mamadyonline

this would be similar to the actual implementation of cosine similiraty

Yes, but adjusted cosine is even closer to pearson similarity.

with common_ratings_only=True

There is no common_ratings_only option for now, because similarities are always computed using common ratings. This option will come once we address #164.

NicolasHug avatar Apr 30 '18 11:04 NicolasHug

Ok. I'll try to submit a PR ASAP.

Le lun. 30 avr. 2018 à 13:41, Nicolas Hug [email protected] a écrit :

this would be similar to the actual implementation of cosine similiraty

Yes, but adjusted cosine is even closer to pearson similarity.

with common_ratings_only=True

There is no common_ratings_only option for now, because similarities are always computed using common ratings. This option will come once we address #164 https://github.com/NicolasHug/Surprise/issues/164.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NicolasHug/Surprise/issues/163#issuecomment-385374643, or mute the thread https://github.com/notifications/unsubscribe-auth/ATl3ioOyVPFd8XiYD8N3RtJ3LytvUnKmks5ttvh9gaJpZM4TFU5W .

mamadyonline avatar Apr 30 '18 12:04 mamadyonline

hey there I'm new here, Is there any one to help me? I want to add a new similarity measure but there are already some bugs in the similarities.pyx how can I use it? how can I fix it?

ghazalaak avatar May 01 '18 10:05 ghazalaak

@ghazalaak please don't highjack unrelated issues. Open a new one if you need to (you'll have to be a lot more specific though).

NicolasHug avatar May 01 '18 10:05 NicolasHug