Skip to main content

Build personalized machine learning models for Tinder based on your historical preference

Project description

tindetheus

Build personalized machine learning models for Tinder based on your historical preference using Python.

There are three parts to this:

  1. A function to build a database which records everything about the profiles you've liked and disliked.
  2. A function to train a model to your database.
  3. A function to use the trained model to automatically like and dislike new profiles.

How it works

The last layer of a CNN trained for facial classification can be used as a feature set which describes an individual's face. It just so happens that this feature set is related to facial attractiveness.

tindetheus let's you build a database based on the profiles that you like and dislike. You can then train a classification model to your database. The model training first uses a MTCNN to detect and box the faces in your database. Then a facenet model is run on the faces to extract the embeddings (last layer of the CNN). A logistic regression model is then fit to the embeddings. The logistic regression model is saved, and this processes is repeated in automation to automatically like and dislike profiles based on your historical preference.

Visual aid explaining tindetheus

This blog post has a short description of how tindetheus works.

For a more detailed description of how and why this works see https://arxiv.org/abs/1803.04347

Example usage

tindetheus browse

build a database by liking and disliking profiles on Tinder. The database contains all the profile information as a numpy array, while the profile images are saved in a different folder.

tindetheus browse --distance=20

by default tindetheus starts with a 5 mile radius, but you can specify a search distance by specifying --distance. The above example is to start with a 20 mile search radius. It is important to note that when you run out of nearby users, tindethesus will ask you if you'd like to increase the search distance by 5 miles.

tindetheus train

Use machine learning to build a personalized model of who you like and dislike based on your database. The more profiles you've browsed, the better your model will be.

tindetheus like

Use your personalized model to automatically like and dislike profiles. The profiles which you have automatically liked and disliked are stored in al_database. By default this will start with a 5 mile search radius, which increases by 5 miles until you've used 100 likes. You can change the default search radius by using

tindetheus like --distance=20

which would start with a 20 mile search radius.

Installation and Getting started

Installation and getting started guide now stored in GETTING_STARTED.md

.env

You can now store all default optional parameters in your environment variables! This means you can set your starting distance, number of likes, and image_batch size without manually specifying the options each time. This is an example .env file:

FACEBOOK_AUTH_TOKEN="TODO" # your facebook token hash
# alternatively you can use the XAuthToken
# TINDER_AUTH_TOKEN="TODO"
TINDETHEUS_MODEL_DIR="/models/20170512-110547"  # the location of your facenet model directory
# see https://github.com/davidsandberg/facenet#pre-trained-models for other
# pretrained facenet models
TINDETHEUS_IMAGE_BATCH=1000  # number of images to load in a batch during train
#  the larger the image_batch size, the faster the training process, at the
#  cost of additional memory. A 4GB machine may struggle with 1000 images.
TINDETHEUS_DISTANCE=5  # Set the starting distance in miles
TINDETHEUS_LIKES=100  # set the number of likes you want to use
#  note that free Tinder users only get 100 likes in 24 hours
TINDETHEUS_RETRIES=20

Using the validate function on a different dataset

As of Version 0.4.0, tindetheus now includes a validate function. This validate functions applies your personally trained tinder model on an external set of images. If there is a face in the image, the model will predict whether you will like or dislike this face. The results are saved in validation.csv. For more information about the validate function read this.

Dataset available upon request

The dataset used to create this work is available upon request. Please fill out this form to request access to the data.

Changelog

All changes now stored in CHANGELOG.md

Open source libraries

tindetheus uses the following open source libraries:

About the name

Tindetheus is a combination of Tinder (the popular online dating application) and the Greek Titans: Prometheus and Epimetheus. Prometheus signifies "forethought," while his brother Epimetheus denotes "afterthought". In synergy they serve to improve your Tinder experience.

Epimetheus creates a database from all of the profiles you review on Tinder.

Prometheus learns from your historical preferences to automatically like new Tinder profiles.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tindetheus-1.0.2.tar.gz (1.9 MB view details)

Uploaded Source

File details

Details for the file tindetheus-1.0.2.tar.gz.

File metadata

  • Download URL: tindetheus-1.0.2.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.10

File hashes

Hashes for tindetheus-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1438647c51587d661f491e78cbf9d8229469aeb4027459c9d8b661f9da8bcf96
MD5 354f837dfe2549df6f8fba5ffde940a2
BLAKE2b-256 d17611d02ab02452cfa5871bc0007319225ebd19a81b4e96fedc1ae183983a13

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page