Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interest and location based algorithm for android mobile app

I am trying to work on android mobile app where I have a functionality to find matches according to interest and location. Many dating apps are already doing some kinda functionality for example Tinder matches based on locations, gender and age etc.

I do not want to reinvent the wheel if it has been done already. I have searched on google and some suggested to use clustering algorithm for this Algorithm for clustering people with similar interests User similarities algorithm

Lets I have data in this JSON format for users

User1: {location: "Delhi, India", interests: ["Jogging", "Travelling", "Praying"] }
User2: {location: "Noida, India", interests: ["Running", "Eating", "Praying"] }
User3: {location: "Bangalore, India", interests: ["Exercise", "Visiting new places", "Chanting"] }

I am writing a matching algorithm that matches few below criteria -

  1. If user1 is having an interest in "Jogging" and another user2 is having an interest in "Running" so as jogging and running is alternatively a kind of exercise so they should match both the profiles as well as it should be location wise also as nearest should be on top.

  2. The algorithm, when running at scale, should be fairly performant. This means I'd like to avoid comparing each user individually to each other user. For N users this is an O(N^2) operation. Ideally, I'd like to develop some sort of "score" that I can generate for each user in isolation since this involves looping through all users only once. Then I can find other users with similar scores and determine the best match based off that.

Can anyone suggest me with some implementation of how can I achieve this with the help of firebase-cloud-function and firebase-database.

like image 875
N Sharma Avatar asked Apr 23 '17 16:04

N Sharma


2 Answers

I think hard coding similarity is a wrong approach. FYI none of the major search engines rely on such mappings.

A better approach is to be more data driven. Create an ad hoc methodology to start with and once you have sufficient data build machine learning models to rank matches. This way you do not have to assume anything.

For the location, have some kind of a radius (preferably this can be set by the user) and match people within the radius.

like image 104
ElKamina Avatar answered Nov 20 '22 03:11

ElKamina


First of all i would say get rid of the redundant features in your dataset, Jogging and running could be 1 feature instead of 2, also after that you can use K-means algorithm to group data in an unsupervised way to learn more about K-means you can go to this link: https://www.coursera.org/learn/machine-learning/lecture/93VPG/k-means-algorithm

Also as you're building an online system, it has to improve itself everyday You can watch this for learning a bit more about online learning https://www.coursera.org/learn/machine-learning/lecture/ABO2q/online-learning

Also https://www.coursera.org/learn/machine-learning/lecture/DoRHJ/stochastic-gradient-descent this stochastic gradient will be helpful to know.

These are conceptual videos do not implement anything yourself, you can always use a library like tensorflow https://www.tensorflow.org/

I know this looks a bit hard to understand but you'll need this knowledge in order to build your own custom recommendation system.

like image 3
Ankit Arora Avatar answered Nov 20 '22 04:11

Ankit Arora