Recommender engine in python - incorporate custom similarity metrics
I would keep it simple and separate:
Your focus is collaborative filtering, so your recommender should generate scores for the top N recommendations regardless of location.
Then you can re-score using distance among those top-N.  For a simple MVP, you could start with an inverse distance decay (e.g. final-score = cf-score * 1/distance), and adjust the decay function based on behavioral evidence if necessary.
I am currently building a recommender engine in python and I faced the following problem.
I want to incorporate collaborative filtering approach, its user-user variant. To recap, its idea is that we have an information on different users and which items they liked (if applicable - which ratings these users assigned to items). When we have new user who liked couple of things we just find users who liked same items and recommend to this new user items which were liked by users similar to new user.
But I want to add some twist to it. I will be recommending places to users, namely 'where to go tonight'. I know user preferences, but I want to also incorporate the distance to each item I could recommend. The father the place I am going to recommend to the user - the least attractive it should be.
So in general I want to incorporate a penalty into recommendation engine and the amount of penalty for each place will be based on the distance from user to the place.
I tried to googleif anyone did something similar but wasn't able to find anything. Any advice on how to properly add such penalty?