r/learnpython • • Dec 16 '24

How to create dating app algorithm without filtering

I want to create a dating algorithm that will suggest people according to user interactions and behavior. If a user interacts with female users, then suggest females; if they start interacting with males, then show them males. If a user likes individuals from a specific country or ethnicity, show profiles from those categories without using explicit query filtering. What can I do to achieve this?

2 Upvotes

12 comments sorted by

15

u/noidontneedtherapy Dec 16 '24

Learn about recommendation systems.

-14

u/ImprovementAlive870 Dec 16 '24

Data scarcity is the issue and also that's very complex to build, Though thanks for commenting.

18

u/LohaYT Dec 16 '24

Data scarcity is an issue that every system like this has to address, it’s not unique to your situation, and thus a lot of work in recommendation systems focuses on solving the issue

-4

u/ImprovementAlive870 Dec 16 '24

Agreed

5

u/LohaYT Dec 16 '24

Ok great. My point was that data scarcity is not a reason not to look into recommendation systems. Neither is complexity

1

u/Pythagorean_1 Dec 16 '24

What have you tried so far that isn't working?

2

u/ImprovementAlive870 Dec 17 '24 edited Dec 17 '24

Right now I've implemented TF-IDF Vectorizer and k-Nearest Neighbors The code combines user profile features into a single string, transforms them into TF-IDF vectors, and calculates cosine similarity to find similar users based on their interactions.

Yesterday I added weights in Gender, Religion to Improve accuracy and It improved accuracy, But weights are not that working with age.

And I don't know how to work with geolocations and stuff!

I have 200 dummy data, and it's working fine with it, but with less data and more fields, like ethnicity, nationality, and more fields I include, accuracy fades away.

That's what I'm dealing with right now.

1

u/ztexxmee Dec 16 '24

my best guess is think of it like a table with rows and columns. you could make each row a user, and each column a category that has details about said user. one column could be a detail about what the user likes such as male, female, etc.. you can then use these features of each user to suggest them stuff. you may also be able to make multiple tables and find someway to relate them to each other so there can be more dimensions.

-2

u/karachiwala Dec 16 '24

Maybe you should consider a NoSQL DB that stores a JSON object for a user. This object should have the preference and anything else you may find important for matching a user to other users.

This will help you build the MVP of your app and test the idea with the first 100 or so users.

Python has great libraries for parsing JSON and dictionary objects that will get you off the ground quickly.