Giter Site home page Giter Site logo

gabriel-ballesteros / spotify-recommender Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 6.0 847 KB

Music recommender using Flask, PostgreSQL and the Spotify API

Home Page: http://spotify-recommender.gabrielballesteros.com

Python 10.19% CSS 0.35% HTML 86.40% JavaScript 3.06%
python spotify-api postgresql flask recommender-system recommendation-system bootstrap music music-recommendation music-recommendation-system

spotify-recommender's Introduction

You can try this recommender here

How does it work?

Basically, it asks for the user to select their favorite tracks from Spotify, then it compares each of them - one by one - with every track in the recommender dataset. In order to do this it gets the tracks' audio features provided by the Spotify API and computes the euclidean distance between the inputted tracks and the dataset tracks to generate a similarity index. The recommended tracks are the ones from the dataset with the highest similarity index compared to each of the inputted tracks (closest to 1.0).

The distance

The general idea is to compare the difference between all the features of the inputted tracks against the features of each of the tracks in the dataset. To do this, we use euclidean distance.

For example, if we had only 2 features (or dimensions) named 1 as the horizontal axis and 2 as the vertical axis, we could see the tracks as the points p and q and the distance between them in a plane like this:

Pythagoras

Or, if we had more dimensions n like in our case where n = 8:

Euclidean

Where p and q are the tracks and the subindexes (1, 2, ..., i, ..., n) are the features (acousticness, danceability, etc.)

Then we normalize the similarity with the following index:

Similarity

and choose the track with similarity closest to 1.0 among the ones in the dataset.

spotify-recommender's People

Contributors

gabriel-ballesteros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.