GithubHelp home page GithubHelp logo

adidottxt / spotify-music-discovery Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 2.0 6.41 MB

create your own spotify recommendation algorithm ๐ŸŽง

Jupyter Notebook 28.47% Python 71.53%
spotify music-recommendation machine-learning active-learning spotify-api

spotify-music-discovery's Introduction

๐ŸŽง Spotify Music Discovery

Create your own Spotify recommendation algorithm. All you need is Python 3, Jupyter Notebook, and a Spotify account.

Setup

  1. Clone/download the repository.
  2. Ensure that you have Python 3 and Jupyter Notebook installed.
  3. Navigate to /spotify-music-discovery and run pip install -r requirements.txt.
  4. Create the file spotify-music-discovery/pkg/config.py as below, using your Spotify client information.
CLIENT_ID = 'your Spotify client id here'
CLIENT_SECRET = 'your Spotify client secret here'
CLIENT_USERNAME = 'your Spotify username here'
  1. To help avoid any OAuth errors that might occur, open your Spotify application here, and set up your Redirect URIs as follows:
  • Edit Settings
    • Add http://localhost:8888/callback/ under "Redirect URIs"
  1. When prompted in get_spotify_data, copy and paste the link you are redirected to in the input box that should pop up after running the first cell (even if the link throws a "localhost redirected you too many times" error).

Usage

  • Start Jupyter Notebook in the /spotify-music-discovery directory.
  • Run through the notebooks in sequence, following the instructions in each:
    1. get_spotify_data
      • Downloads and parses song data from the training playlists you specify.
    2. train
      • Trains classifiers using the training data and saves the best one.
        • Specifically, it pickles the classifier object and writes it to the ./classifiers directory.
    3. predict
      • Predicts which songs you like from a playlist you specify.

Spotify URIs

To download playlists, you will have to specify their Spotify URIs. You can get Spotify URIs from the Spotify app, as follows:

  • Right-click on a playlist
    • Share
      • Copy Spotify URI

Background

This repo was originally created for a final project in an applied machine learning course at the University of Pennsylvania. For more detail, including the algorithms used, see the project report.

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.