Help: Designing Models for Matches in a Dating App?
I’m working on a dating app for a hackathon project. We have a series of questions that users fill out, and then every few days we are going to send suggested matches. If anyone has a good tutorial for these kinds of matching algorithms, it would be very appreciated. One idea is to assign a point value for each question and then to do a
def comparison(person_a, person_b) function where you iterate through these questions, and where there’s a common answer, you add in a point. So the higher the score, the better the match. I understand this so far, but I’m struggling to see how to save this data in the database.
In python, I could take each user and then iterate through all the other users with this comparison function and make a dictionary for each person that lists all the other users and a score for them. And then to suggest matches, I iterate through the dictionary list and if that person hasn’t been matched up already with that person, then make a match.
person1_dictionary_of_matches = {‘person2’: 3, ‘person3’: 5, ‘person4’: 10, ‘person5’: 12, ‘person6’: 2,……,‘person200’:10}
person_1_list_of_prior_matches = [‘person3’, 'person4']
I'm struggling on how to represent this in django. I could have a bunch of users and make a Match model like:
class Match(Model):
person1 = models.ForeignKey(User)
person2 = models.ForeignKey(User)
score = models.PositiveIntegerField()
Where I do the iteration and save all the pairwise scores.
and then do
person_matches = Match.objectsfilter(person1=sarah, person2!=sarah).order_by('score').exclude(person2 in list_of_past_matches)
But I’m worried with 1000 users, I will have 1000000 rows in my table if do this. Will this be brutal to have to save all these pairwise scores for each user in the database? Or does this not matter if I run it at like Sunday night at 1am or just cache these responses once and use the comparisons for a period of months? Is there a better way to do this than matching everyone up pairwise? Should I use some other data structure to capture the people and their compatibility score? Thanks so much for any guidance!
/r/django
https://redd.it/7lo21q
I’m working on a dating app for a hackathon project. We have a series of questions that users fill out, and then every few days we are going to send suggested matches. If anyone has a good tutorial for these kinds of matching algorithms, it would be very appreciated. One idea is to assign a point value for each question and then to do a
def comparison(person_a, person_b) function where you iterate through these questions, and where there’s a common answer, you add in a point. So the higher the score, the better the match. I understand this so far, but I’m struggling to see how to save this data in the database.
In python, I could take each user and then iterate through all the other users with this comparison function and make a dictionary for each person that lists all the other users and a score for them. And then to suggest matches, I iterate through the dictionary list and if that person hasn’t been matched up already with that person, then make a match.
person1_dictionary_of_matches = {‘person2’: 3, ‘person3’: 5, ‘person4’: 10, ‘person5’: 12, ‘person6’: 2,……,‘person200’:10}
person_1_list_of_prior_matches = [‘person3’, 'person4']
I'm struggling on how to represent this in django. I could have a bunch of users and make a Match model like:
class Match(Model):
person1 = models.ForeignKey(User)
person2 = models.ForeignKey(User)
score = models.PositiveIntegerField()
Where I do the iteration and save all the pairwise scores.
and then do
person_matches = Match.objectsfilter(person1=sarah, person2!=sarah).order_by('score').exclude(person2 in list_of_past_matches)
But I’m worried with 1000 users, I will have 1000000 rows in my table if do this. Will this be brutal to have to save all these pairwise scores for each user in the database? Or does this not matter if I run it at like Sunday night at 1am or just cache these responses once and use the comparisons for a period of months? Is there a better way to do this than matching everyone up pairwise? Should I use some other data structure to capture the people and their compatibility score? Thanks so much for any guidance!
/r/django
https://redd.it/7lo21q
reddit
Help: Designing Models for Matches in a Dating App? • r/django
I’m working on a dating app for a hackathon project. We have a series of questions that users fill out, and then every few days we are going to...
An example of Django project with login, registration, password change, log out, and password reset functionality [UPDATE 3.0]
https://www.reddit.com/r/django/comments/7kwy9w/an_example_of_django_project_with_login/
/r/Python
https://redd.it/7lngr9
https://www.reddit.com/r/django/comments/7kwy9w/an_example_of_django_project_with_login/
/r/Python
https://redd.it/7lngr9
reddit
An example of Django project with login, registration,... • r/django
Links: - Repository: https://github.com/egorsmkv/simple-django-login-and-register - Previous post about 2.0 version:...
Python Top 10 Articles - Dec 2017
https://medium.com/@Mybridge/python-top-10-articles-for-the-past-month-v-dec-2017-20a36e77b3cc
/r/Python
https://redd.it/7lok73
https://medium.com/@Mybridge/python-top-10-articles-for-the-past-month-v-dec-2017-20a36e77b3cc
/r/Python
https://redd.it/7lok73
Medium
Python Top 10 Articles for the Past Month (v.Dec 2017)
For the past month, we ranked nearly 1,100 Python articles to pick the Top 10 stories that can help advance your career (0.9% chance).
A mini-tutorial on deploying smart contracts with python
I wanted to learn smart contract development for work and started off with a simple tutorial that was in javascript. To challenge myself I started converting the tutorial to python.
https://github.com/adamyala/Your_First_Decentralized_Application_Python
I tried to make it as simple as possible and added lots of notes I wish I had when I was learning.
I'd love to know if there is anything I can add/change to make it clearer and more simple. My goal is to eventually convert the entire thing to 100% python.
/r/Python
https://redd.it/7lr48g
I wanted to learn smart contract development for work and started off with a simple tutorial that was in javascript. To challenge myself I started converting the tutorial to python.
https://github.com/adamyala/Your_First_Decentralized_Application_Python
I tried to make it as simple as possible and added lots of notes I wish I had when I was learning.
I'd love to know if there is anything I can add/change to make it clearer and more simple. My goal is to eventually convert the entire thing to 100% python.
/r/Python
https://redd.it/7lr48g
GitHub
GitHub - adamyala/Your_First_Decentralized_Application_Python: An up to date and bare minimum tutorial on deploying smart contracts…
An up to date and bare minimum tutorial on deploying smart contracts with python - adamyala/Your_First_Decentralized_Application_Python
[D] What ML publication hacks are you familiar with, and which annoy you the most?
This is in line with "When a measure becomes a target, it ceases to be a good measure."
In ML literature (and other literature, especially academic) the measure/target is 'good reviews from reviewers'.
So which publication hacks are you familiar with, and which annoy you the most?
I'll start, motivated by a comment from https://github.com/hengyuan-hu/bottom-up-attention-vqa :
> The third point is simply because we feel the two stream classifier and pre-training in the original paper is over-complicated and not necessary.
Hack: Begin complex, and do not 'waste' your time with ablation studies / trying to simplify.
Reason this improves the measure/target: Reviewers will more often complain about simplicity ('incremental research') than complexity.
Reason this sucks for everyone involved except the authors: Leads to overly complex models, with little to no understanding of which components are actually useful.
Edit: Fixed URL
/r/MachineLearning
https://redd.it/7lq58j
This is in line with "When a measure becomes a target, it ceases to be a good measure."
In ML literature (and other literature, especially academic) the measure/target is 'good reviews from reviewers'.
So which publication hacks are you familiar with, and which annoy you the most?
I'll start, motivated by a comment from https://github.com/hengyuan-hu/bottom-up-attention-vqa :
> The third point is simply because we feel the two stream classifier and pre-training in the original paper is over-complicated and not necessary.
Hack: Begin complex, and do not 'waste' your time with ablation studies / trying to simplify.
Reason this improves the measure/target: Reviewers will more often complain about simplicity ('incremental research') than complexity.
Reason this sucks for everyone involved except the authors: Leads to overly complex models, with little to no understanding of which components are actually useful.
Edit: Fixed URL
/r/MachineLearning
https://redd.it/7lq58j
GitHub
GitHub - hengyuan-hu/bottom-up-attention-vqa: An efficient PyTorch implementation of the winning entry of the 2017 VQA Challenge.
An efficient PyTorch implementation of the winning entry of the 2017 VQA Challenge. - GitHub - hengyuan-hu/bottom-up-attention-vqa: An efficient PyTorch implementation of the winning entry of the 2...
Fastest way to uniquify a list in Python >=3.6
https://www.peterbe.com/plog/fastest-way-to-uniquify-a-list-in-python-3.6
/r/Python
https://redd.it/7lqu97
https://www.peterbe.com/plog/fastest-way-to-uniquify-a-list-in-python-3.6
/r/Python
https://redd.it/7lqu97
Evolving Simple Organisms using a Genetic Algorithm and Deep Learning from Scratch with Python – nathanrooy.github.io
https://nathanrooy.github.io/posts/2017-11-30/evolving-simple-organisms-using-a-genetic-algorithm-and-deep-learning/?utm_source=mybridge&utm_medium=blog&utm_campaign=read_more
/r/Python
https://redd.it/7lshtb
https://nathanrooy.github.io/posts/2017-11-30/evolving-simple-organisms-using-a-genetic-algorithm-and-deep-learning/?utm_source=mybridge&utm_medium=blog&utm_campaign=read_more
/r/Python
https://redd.it/7lshtb
nathanrooy.github.io
Evolving Simple Organisms using a Genetic Algorithm and Deep Learning from Scratch with Python
Nathan A. Rooy | nathanrooy.github.io
How do I create a checkbox using model fields?
I have to create a field in a model, what field class can I use to represent the checkbox? How can I use this in the Modelform?
/r/django
https://redd.it/7lurgg
I have to create a field in a model, what field class can I use to represent the checkbox? How can I use this in the Modelform?
/r/django
https://redd.it/7lurgg
reddit
How do I create a checkbox using model fields? • r/django
I have to create a field in a model, what field class can I use to represent the checkbox? How can I use this in the Modelform?
notifiers 0.6.0 released. 4 new notifiers, a total of 9 and going strong
https://github.com/liiight/notifiers
/r/Python
https://redd.it/7luntc
https://github.com/liiight/notifiers
/r/Python
https://redd.it/7luntc
GitHub
GitHub - liiight/notifiers: The easy way to send notifications
The easy way to send notifications. Contribute to liiight/notifiers development by creating an account on GitHub.
The state of Python 3 adoption
https://rushter.com/blog/python-3-adoption/
/r/Python
https://redd.it/7lwxxf
https://rushter.com/blog/python-3-adoption/
/r/Python
https://redd.it/7lwxxf
[AF] SocketIO -- Server not opening websocket connection
Hi, I'm trying to run a (very) simple websocket server.
I'm trying to connect using a command line tool:
> $ wscat -c ws://localhost:5000/
Starting the server, and running the *wscat* request, I see:
* Serving Flask-SocketIO app "main"
* Forcing debug mode on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 243-427-340
(1983) wsgi starting up on http://127.0.0.1:5000
(1983) accepted ('127.0.0.1', 50372)
127.0.0.1 - - [24/Dec/2017 09:19:18] "GET / HTTP/1.1" 200 132 0.003266
It's making the http connection, but doesn't seem to be promoting to websockets. There's a debugging "print" doesn't print, and an "emit" that doesn't emit for the "connect".
I can use *wscat* to connect to echo servers just fine.
I'm clearly not doing something right, I'm just really not sure what!
I've tried with web pages too -- but here I'm trying to keep it simple.
[GitHub app](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/main.py)
[conda installed requirements](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/requirements_conda.txt)
[pip installed requirements](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/requirements.txt)
I'd really appreciate another pair of eyes, if anyone has troubleshooting advice or can see a bug.
Thanks, and Happy Christmas!
EDIT:
I just tried running Miguel Grinberg's Flask-SocketIO off of github, but with the same environment I was running my own test with.
It works!
Though some of the responses are labelled polling, and some are websockets, which seems funny to me that it's doing both in the same browser.
But this confirms it's me not seeing / understanding some concept.
127.0.0.1 - - [24/Dec/2017 14:43:40] "GET / HTTP/1.1" 200 6028 0.001638
127.0.0.1 - - [24/Dec/2017 14:43:40] "GET /socket.io/?EIO=3&transport=polling&t=1514144620687-0 HTTP/1.1" 200 381 0.001277
(2632) accepted ('127.0.0.1', 51051)
Client disconnected 19392765e6d8415f9c2654d2cf924186
127.0.0.1 - - [24/Dec/2017 14:47:18] "GET /socket.io/?EIO=3&transport=websocket&sid=19392765e6d8415f9c2654d2cf924186 HTTP/1.1" 200 0 217.415311
/r/flask
https://redd.it/7lvfuh
Hi, I'm trying to run a (very) simple websocket server.
I'm trying to connect using a command line tool:
> $ wscat -c ws://localhost:5000/
Starting the server, and running the *wscat* request, I see:
* Serving Flask-SocketIO app "main"
* Forcing debug mode on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 243-427-340
(1983) wsgi starting up on http://127.0.0.1:5000
(1983) accepted ('127.0.0.1', 50372)
127.0.0.1 - - [24/Dec/2017 09:19:18] "GET / HTTP/1.1" 200 132 0.003266
It's making the http connection, but doesn't seem to be promoting to websockets. There's a debugging "print" doesn't print, and an "emit" that doesn't emit for the "connect".
I can use *wscat* to connect to echo servers just fine.
I'm clearly not doing something right, I'm just really not sure what!
I've tried with web pages too -- but here I'm trying to keep it simple.
[GitHub app](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/main.py)
[conda installed requirements](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/requirements_conda.txt)
[pip installed requirements](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/requirements.txt)
I'd really appreciate another pair of eyes, if anyone has troubleshooting advice or can see a bug.
Thanks, and Happy Christmas!
EDIT:
I just tried running Miguel Grinberg's Flask-SocketIO off of github, but with the same environment I was running my own test with.
It works!
Though some of the responses are labelled polling, and some are websockets, which seems funny to me that it's doing both in the same browser.
But this confirms it's me not seeing / understanding some concept.
127.0.0.1 - - [24/Dec/2017 14:43:40] "GET / HTTP/1.1" 200 6028 0.001638
127.0.0.1 - - [24/Dec/2017 14:43:40] "GET /socket.io/?EIO=3&transport=polling&t=1514144620687-0 HTTP/1.1" 200 381 0.001277
(2632) accepted ('127.0.0.1', 51051)
Client disconnected 19392765e6d8415f9c2654d2cf924186
127.0.0.1 - - [24/Dec/2017 14:47:18] "GET /socket.io/?EIO=3&transport=websocket&sid=19392765e6d8415f9c2654d2cf924186 HTTP/1.1" 200 0 217.415311
/r/flask
https://redd.it/7lvfuh
GitHub
hanhanhan/fake_bus_api
Contribute to fake_bus_api development by creating an account on GitHub.
Best of /r/Python 2017
This is our Best of 2017 thread.
Submit things that you loved about /r/Python this year. It can be people, posts, comments, or whatever you want, as long as it is something that is in this subreddit.
Going to keep this post stickied until January 2nd, then hand out some gold to the people that the votes tell us are the best!
Merry Christmas everyone!
/r/Python
https://redd.it/7lyxpw
This is our Best of 2017 thread.
Submit things that you loved about /r/Python this year. It can be people, posts, comments, or whatever you want, as long as it is something that is in this subreddit.
Going to keep this post stickied until January 2nd, then hand out some gold to the people that the votes tell us are the best!
Merry Christmas everyone!
/r/Python
https://redd.it/7lyxpw
reddit
Best of /r/Python 2017 • r/Python
This is our Best of 2017 thread. Submit things that you loved about /r/Python this year. It can be people, posts, comments, or whatever you...
Jupyter Auto Starting in Atom Terminal
Not sure if this is the right place to post this but I thought I'd try.
Whenever I run the terminal in atom, it automatically starts a jupyter notebook. Not sure why this happens but its really annoying.
I also opened just a terminal window directly. It opened fine but this was the second line in the window:
env: jupyter-notebook: No such file or directory
Not sure what's going on here... Any help would be appreciated!
/r/Python
https://redd.it/7lz9rm
Not sure if this is the right place to post this but I thought I'd try.
Whenever I run the terminal in atom, it automatically starts a jupyter notebook. Not sure why this happens but its really annoying.
I also opened just a terminal window directly. It opened fine but this was the second line in the window:
env: jupyter-notebook: No such file or directory
Not sure what's going on here... Any help would be appreciated!
/r/Python
https://redd.it/7lz9rm
reddit
Jupyter Auto Starting in Atom Terminal • r/Python
Not sure if this is the right place to post this but I thought I'd try. Whenever I run the terminal in atom, it automatically starts a jupyter...
How to read CSV file in Python
https://www.alexkras.com/how-to-read-csv-file-in-python/
/r/Python
https://redd.it/7m0164
https://www.alexkras.com/how-to-read-csv-file-in-python/
/r/Python
https://redd.it/7m0164
alexkras.com
How to read CSV file in Python
Let’s say we have the following CSV file, named . You can download this file here. The first method demonstrated in Python docs would read the file as follows: Open the file Create a CSV reader Skip…
context in class-based views
So I recently switched to class based views, and found this code to pass in additional context to template:
class DetailView(generic.DetailView):
model = Language
template_name = 'languages/detail.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['year'] = Details.objects.filter(year=2016)
return context
However, I fail to be able to display values/the variable in the HTML. How do i go about this in template.html?
/r/django
https://redd.it/7m01au
So I recently switched to class based views, and found this code to pass in additional context to template:
class DetailView(generic.DetailView):
model = Language
template_name = 'languages/detail.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['year'] = Details.objects.filter(year=2016)
return context
However, I fail to be able to display values/the variable in the HTML. How do i go about this in template.html?
/r/django
https://redd.it/7m01au
reddit
context in class-based views • r/django
So I recently switched to class based views, and found this code to pass in additional context to template: class...
[News] New NVIDIA EULA prohibits Deep Learning on GeForce GPUs in data centers.
According to German tech magazine golem.de, the new NVIDIA EULA prohibits Deep Learning applications to be run on GeForce GPUs.
Sources:
https://www.golem.de/news/treiber-eula-nvidia-untersagt-deep-learning-auf-geforces-1712-131848.html
http://www.nvidia.com/content/DriverDownload-March2009/licence.php?lang=us&type=GeForce
The EULA states:
"No Datacenter Deployment. The SOFTWARE is not licensed for datacenter deployment, except that blockchain processing in a datacenter is permitted."
EDIT: Found an English article: https://wirelesswire.jp/2017/12/62708/
/r/MachineLearning
https://redd.it/7ly5gi
According to German tech magazine golem.de, the new NVIDIA EULA prohibits Deep Learning applications to be run on GeForce GPUs.
Sources:
https://www.golem.de/news/treiber-eula-nvidia-untersagt-deep-learning-auf-geforces-1712-131848.html
http://www.nvidia.com/content/DriverDownload-March2009/licence.php?lang=us&type=GeForce
The EULA states:
"No Datacenter Deployment. The SOFTWARE is not licensed for datacenter deployment, except that blockchain processing in a datacenter is permitted."
EDIT: Found an English article: https://wirelesswire.jp/2017/12/62708/
/r/MachineLearning
https://redd.it/7ly5gi
Golem.de
Nvidia untersagt Geforces in Rechenzentren
Wer eine Geforce oder Titan verwendet, darf diese Nvidia-Karten der aktualisierten Endbenutzer-Lizenzvereinbarung zufolge nicht mehr in Rechenzentren, etwa für Deep Learning,
An example of Django project with login, registration, password change, log out, and password reset functionality [UPDATE 3.0]
https://www.reddit.com/r/django/comments/7kwy9w/an_example_of_django_project_with_login/
/r/djangolearning
https://redd.it/7m0yus
https://www.reddit.com/r/django/comments/7kwy9w/an_example_of_django_project_with_login/
/r/djangolearning
https://redd.it/7m0yus
reddit
An example of Django project with login, registration,... • r/django
Links: - Repository: https://github.com/egorsmkv/simple-django-login-and-register - Previous post about 2.0 version:...
Django's autoreload function is unusably slow
Hello.
I have never had this problem in the past, but I am starting a new project and Django's autoreload feature (where it restarts the server after a code change) has been ridiculously slow (15 seconds - never). I am using WSL. I think this is something new with Django 2.0.
/r/django
https://redd.it/7m0gqu
Hello.
I have never had this problem in the past, but I am starting a new project and Django's autoreload feature (where it restarts the server after a code change) has been ridiculously slow (15 seconds - never). I am using WSL. I think this is something new with Django 2.0.
/r/django
https://redd.it/7m0gqu
reddit
Django's autoreload function is unusably slow • r/django
Hello. I have never had this problem in the past, but I am starting a new project and Django's autoreload feature (where it restarts the server...